[icinga-checkins] icinga.org: icinga2/master: Improve log message for connecting nodes without configured Endpoint object

git at icinga.org git at icinga.org
Thu Jul 21 13:48:24 CEST 2016


Module: icinga2
Branch: master
Commit: 2d53cdb845d0d4aac9d5d81ac6ed91f2f373b72d
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=2d53cdb845d0d4aac9d5d81ac6ed91f2f373b72d

Author: Michael Friedrich <michael.friedrich at netways.de>
Date:   Thu Jul 21 13:48:00 2016 +0200

Improve log message for connecting nodes without configured Endpoint object

fixes #12194

---

 lib/remote/apilistener.cpp |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/lib/remote/apilistener.cpp b/lib/remote/apilistener.cpp
index 01c7d6d..843294d 100644
--- a/lib/remote/apilistener.cpp
+++ b/lib/remote/apilistener.cpp
@@ -354,12 +354,19 @@ void ApiListener::NewClientHandlerInternal(const Socket::Ptr& client, const Stri
 			}
 		}
 
-		Log(LogInformation, "ApiListener")
-		    << "New client connection for identity '" << identity << "'"
-		    << (verify_ok ? "" : " (client certificate not signed by CA)");
-
 		if (verify_ok)
 			endpoint = Endpoint::GetByName(identity);
+
+		{
+			Log log(LogInformation, "ApiListener");
+
+			log << "New client connection for identity '" << identity << "'";
+
+			if (!verify_ok)
+				log << " (client certificate not signed by CA)";
+			else if (!endpoint)
+				log << " (no Endpoint object found for identity)";
+		}
 	} else {
 		Log(LogInformation, "ApiListener")
 		    << "New client connection (no client certificate)";



More information about the icinga-checkins mailing list