From 7c70d51b2713b9a47527ee7435adc2129d5cb006 Mon Sep 17 00:00:00 2001 From: Jean Flach Date: Fri, 28 Apr 2017 16:51:23 +0200 Subject: [PATCH] Add a few extra log messages fixes #5212 --- lib/base/application.cpp | 4 ++++ lib/remote/apilistener-filesync.cpp | 17 +++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 477962da79b..b6bb028617f 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -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); diff --git a/lib/remote/apilistener-filesync.cpp b/lib/remote/apilistener-filesync.cpp index 92f450bc39b..7df44061d8b 100644 --- a/lib/remote/apilistener-filesync.cpp +++ b/lib/remote/apilistener-filesync.cpp @@ -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) @@ -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::digits10 + 1) + << oldTimestamp << "' is more recent than new one '" << newTimestamp << "'."; return false; + } + + Log(LogInformation, "ApiListener") + << "New timestamp '" << std::setprecision (std::numeric_limits::digits10 + 1) << newTimestamp + << "' is more recent than old one '" << oldTimestamp << "'."; { ObjectLock olock(newConfig); @@ -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");