Merge pull request #10207 from Icinga/log-connected-endpoint-connection-attempts

ApiListener: Log connection attempts from an already connected client prominently
This commit is contained in:
Yonas Habteab 2024-10-30 13:31:44 +01:00 committed by GitHub
commit 10775f4481
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 2 deletions

View File

@ -843,9 +843,11 @@ void ApiListener::NewClientHandlerInternal(
Log(LogNotice, "ApiListener", "New JSON-RPC client");
if (endpoint && endpoint->GetConnected()) {
Log(LogNotice, "ApiListener")
Log(LogInformation, "ApiListener")
<< "Ignoring JSON-RPC connection " << conninfo
<< ". We're already connected to Endpoint '" << endpoint->GetName() << "'.";
<< ". We're already connected to Endpoint '" << endpoint->GetName()
<< "' (last message sent: " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endpoint->GetLastMessageSent())
<< ", last message received: " << Utility::FormatDateTime("%Y-%m-%d %H:%M:%S", endpoint->GetLastMessageReceived()) << ").";
return;
}