mirror of
https://github.com/valitydev/osquery-1.git
synced 2024-11-07 18:08:53 +00:00
Merge pull request #469 from theopolis/logging-nits
Move expected errors to info log
This commit is contained in:
commit
9a6a69a224
@ -32,8 +32,8 @@ DEFINE_osquery_flag(string,
|
||||
"The path to the pidfile for osqueryd.");
|
||||
|
||||
std::string getHostname() {
|
||||
char hostname[256];
|
||||
memset(hostname, 0, 255);
|
||||
char hostname[256]; // Linux max should be 64.
|
||||
memset(hostname, 0, 256);
|
||||
gethostname(hostname, 255);
|
||||
std::string hostname_string = std::string(hostname);
|
||||
boost::algorithm::trim(hostname_string);
|
||||
|
@ -62,11 +62,11 @@ void launchQueries(const std::vector<OsqueryScheduledQuery>& queries,
|
||||
const int64_t& second) {
|
||||
for (const auto& q : queries) {
|
||||
if (second % q.interval == 0) {
|
||||
LOG(INFO) << "executing query: " << q.query;
|
||||
LOG(INFO) << "Executing query: " << q.query;
|
||||
int unix_time = std::time(0);
|
||||
auto sql = SQL(q.query);
|
||||
if (!sql.ok()) {
|
||||
LOG(ERROR) << "error executing query (" << q.query
|
||||
LOG(ERROR) << "Error executing query (" << q.query
|
||||
<< "): " << sql.getMessageString();
|
||||
continue;
|
||||
}
|
||||
@ -75,7 +75,7 @@ void launchQueries(const std::vector<OsqueryScheduledQuery>& queries,
|
||||
auto status = dbQuery.addNewResults(sql.rows(), diff_results, unix_time);
|
||||
if (!status.ok()) {
|
||||
LOG(ERROR)
|
||||
<< "error adding new results to database: " << status.toString();
|
||||
<< "Error adding new results to database: " << status.toString();
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ QueryData genCronTab() {
|
||||
std::vector<std::string> user_crons;
|
||||
auto status = listFilesInDirectory(kUserCronsPath, user_crons);
|
||||
if (!status.ok()) {
|
||||
LOG(ERROR) << "Could not list user crons from: " << kUserCronsPath << " ("
|
||||
<< status.what() << ")";
|
||||
LOG(INFO) << "Could not list user crons from: " << kUserCronsPath << " ("
|
||||
<< status.toString() << ")";
|
||||
return results;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user