Skip to content

Commit 7c70d51

Browse files
committed
Add a few extra log messages
fixes #5212
1 parent e29e25a commit 7c70d51

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

lib/base/application.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ void Application::Stop(bool runtimeRemoved)
9797
Log(LogCritical, "Application", "Cannot update PID file. Aborting restart operation.");
9898
return;
9999
}
100+
101+
Log(LogDebug, "Application")
102+
<< "Keeping pid '" << m_ReloadProcess << "' open.";
103+
100104
ClosePidFile(false);
101105
} else
102106
ClosePidFile(true);

lib/remote/apilistener-filesync.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void ApiListener::ConfigGlobHandler(ConfigDirInformation& config, const String&
3636
CONTEXT("Creating config update for file '" + file + "'");
3737

3838
Log(LogNotice, "ApiListener")
39-
<< "Creating config update for file '" << file << "'";
39+
<< "Creating config update for file '" << file << "'.";
4040

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

100100
/* skip update if our config is newer */
101-
if (oldTimestamp >= newTimestamp)
101+
if (oldTimestamp >= newTimestamp) {
102+
/* TODO: Less ugly */
103+
Log(LogInformation, "ApiListener")
104+
<< "Old timestamp '" << std::setprecision(std::numeric_limits<double>::digits10 + 1)
105+
<< oldTimestamp << "' is more recent than new one '" << newTimestamp << "'.";
102106
return false;
107+
}
108+
109+
Log(LogInformation, "ApiListener")
110+
<< "New timestamp '" << std::setprecision (std::numeric_limits<double>::digits10 + 1) << newTimestamp
111+
<< "' is more recent than old one '" << oldTimestamp << "'.";
103112

104113
{
105114
ObjectLock olock(newConfig);
@@ -266,6 +275,10 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
266275
return Empty;
267276
}
268277

278+
Log(LogInformation, "ApiListener")
279+
<< "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName() << "' of zone '"
280+
<< origin->FromZone->GetName() << "'";
281+
269282
Dictionary::Ptr updateV1 = params->Get("update");
270283
Dictionary::Ptr updateV2 = params->Get("update_v2");
271284

0 commit comments

Comments
 (0)