]> granicus.if.org Git - icinga2/commitdiff
Improve logging for ignored config updates where we are authoritative for (config...
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 25 Oct 2018 09:44:49 +0000 (11:44 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Wed, 19 Jun 2019 12:46:11 +0000 (14:46 +0200)
lib/remote/apilistener-filesync.cpp

index 17951a39f194c249b61f04320a4f313e621ead79..a656173187c4fb94d8fb47c071579b8cc48cd8fb 100644 (file)
@@ -376,9 +376,12 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
         */
        boost::mutex::scoped_lock lock(m_ConfigSyncStageLock);
 
+       String fromEndpointName = origin->FromClient->GetEndpoint()->GetName();
+       String fromZoneName = GetFromZoneName(origin->FromZone);
+
        Log(LogInformation, "ApiListener")
-               << "Applying config update from endpoint '" << origin->FromClient->GetEndpoint()->GetName()
-               << "' of zone '" << GetFromZoneName(origin->FromZone) << "'.";
+               << "Applying config update from endpoint '" << fromEndpointName
+               << "' of zone '" << fromZoneName << "'.";
 
        Dictionary::Ptr updateV1 = params->Get("update");
        Dictionary::Ptr updateV2 = params->Get("update_v2");
@@ -407,14 +410,16 @@ Value ApiListener::ConfigUpdateHandler(const MessageOrigin::Ptr& origin, const D
 
                if (!zone) {
                        Log(LogWarning, "ApiListener")
-                               << "Ignoring config update for unknown zone '" << zoneName << "'.";
+                               << "Ignoring config update from endpoint '" << fromEndpointName
+                               << "' for unknown zone '" << zoneName << "'.";
                        continue;
                }
 
                /* Whether we already have configuration in zones.d. */
                if (ConfigCompiler::HasZoneConfigAuthority(zoneName)) {
-                       Log(LogWarning, "ApiListener")
-                               << "Ignoring config update for zone '" << zoneName << "' because we have an authoritative version of the zone's config.";
+                       Log(LogInformation, "ApiListener")
+                               << "Ignoring config update from endpoint '" << fromEndpointName
+                               << "' for zone '" << zoneName << "' because we have an authoritative version of the zone's config.";
                        continue;
                }