diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/PeerFinder.java b/server/src/main/java/org/elasticsearch/cluster/coordination/PeerFinder.java index 3c72ca672d8c6..371f3bc2e080a 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/PeerFinder.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/PeerFinder.java @@ -267,7 +267,7 @@ void handleWakeUp() { requestPeers(); } } else { - logger.trace("{} no longer connected to {}", this, discoveryNode); + logger.trace("{} no longer connected to {}", this); removePeer(); } } @@ -314,7 +314,7 @@ private void requestPeers() { final DiscoveryNode discoveryNode = getDiscoveryNode(); assert discoveryNode != null : "cannot request peers without first connecting"; - logger.trace("{} requesting peers from {}", this, discoveryNode); + logger.trace("{} requesting peers", this); peersRequestInFlight = true; List knownNodes = getFoundPeersUnderLock(); @@ -330,7 +330,7 @@ public PeersResponse read(StreamInput in) throws IOException { @Override public void handleResponse(PeersResponse response) { - logger.trace("{} received {} from {}", Peer.this, response, discoveryNode); + logger.trace("{} received {}", Peer.this, response); synchronized (mutex) { if (active == false) { return; @@ -352,7 +352,7 @@ public void handleResponse(PeersResponse response) { @Override public void handleException(TransportException exp) { peersRequestInFlight = false; - logger.debug("PeersRequest failed", exp); + logger.debug(new ParameterizedMessage("{} peers request failed", this), exp); } @Override @@ -364,7 +364,11 @@ public String executor() { @Override public String toString() { - return "Peer{" + transportAddress + " peersRequestInFlight=" + peersRequestInFlight + "}"; + return "Peer{" + + "transportAddress=" + transportAddress + + ", discoveryNode=" + discoveryNode.get() + + ", peersRequestInFlight=" + peersRequestInFlight + + '}'; } } }