Skip to content

Commit

Permalink
Merge pull request #10207 from Icinga/log-connected-endpoint-connecti…
Browse files Browse the repository at this point in the history
…on-attempts

ApiListener: Log connection attempts from an already connected client prominently
  • Loading branch information
yhabteab authored Oct 30, 2024
2 parents 4ca68e4 + 9d4625e commit 10775f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/remote/apilistener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 10775f4

Please sign in to comment.