Skip to content

Commit

Permalink
Add a few extra log messages
Browse files Browse the repository at this point in the history
fixes #5212
  • Loading branch information
Crunsher committed May 2, 2017
1 parent fca8baf commit 45bbde3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/base/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ void Application::Stop(bool runtimeRemoved)
Log(LogCritical, "Application", "Cannot update PID file. Aborting restart operation.");
return;
}

Log(LogDebug, "Application")
<< "Keeping pid '" << m_ReloadProcess << "' open.";

ClosePidFile(false);
} else
ClosePidFile(true);
Expand Down
17 changes: 15 additions & 2 deletions lib/remote/apilistener-filesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String&
CONTEXT("Creating config update for file '" + file + "'");

Log(LogNotice, "ApiListener")
<< "Creating config update for file '" << file << "'";
<< "Creating config update for file '" << file << "'.";

std::ifstream fp(file.CStr(), std::ifstream::binary);
if (!fp)
Expand Down Expand Up @@ -98,8 +98,17 @@ bool ApiListener::UpdateConfigDir(const ConfigDirInformation& oldConfigInfo, con
newTimestamp = newConfig->Get("/.timestamp");

/* skip update if our config is newer */
if (oldTimestamp >= newTimestamp)
if (oldTimestamp >= newTimestamp) {
/* TODO: Less ugly */
Log(LogInformation, "ApiListener")
<< "Old timestamp '" << std::setprecision(std::numeric_limits<double>::digits10 + 1)
<< "' is more recent than new one '" << newTimestamp << "'.";
return false;
}

Log(LogInformation, "ApiListener")
<< "New timestamp '" << std::setprecision (std::numeric_limits<double>::digits10 + 1) << newTimestamp
<< "' is more recent than old one '" << oldTimestamp << "'.";

{
ObjectLock olock(newConfig);
Expand Down Expand Up @@ -266,6 +275,10 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
return Empty;
}

Log(LogInformation, "ApiListener")
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName() << "' of zone '"
<< origin->FromZone->GetName() << "'";

Dictionary::Ptr updateV1 = params->Get("update");
Dictionary::Ptr updateV2 = params->Get("update_v2");

Expand Down

0 comments on commit 45bbde3

Please sign in to comment.