From 5314b2909e2122a211741372dd6514c09bdd393a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jaroslav=20T=C3=B3th?= Date: Tue, 26 Oct 2021 20:27:25 +0200 Subject: [PATCH] Added channel to logs in NETCONF negotiator MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit - It simplifies debugging and investigation of deployment with a lot of NETCONF MPs. JIRA: NETCONF-827 Change-Id: I221aab35e8d8d63481130678e1c755077125ad74 Signed-off-by: Jaroslav Tóth Signed-off-by: Robert Varga --- .../NetconfClientSessionNegotiator.java | 2 +- .../AbstractNetconfSessionNegotiator.java | 21 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java index 1816fee0e0..46ae45589f 100644 --- a/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java +++ b/netconf/netconf-client/src/main/java/org/opendaylight/netconf/client/NetconfClientSessionNegotiator.java @@ -73,7 +73,7 @@ public class NetconfClientSessionNegotiator extends try { startNegotiation(); } catch (final Exception e) { - LOG.warn("Unexpected negotiation failure", e); + LOG.warn("Unexpected negotiation failure on channel {}", channel, e); negotiationFailed(e); return; } diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java index 978bd381c2..171d8d2cdf 100644 --- a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/AbstractNetconfSessionNegotiator.java @@ -126,12 +126,14 @@ public abstract class AbstractNetconfSessionNegotiator

) future -> { @@ -235,7 +237,7 @@ public abstract class AbstractNetconfSessionNegotiator

{ if (!f.isSuccess()) { - LOG.info("Failed to send message {}", msg, f.cause()); + LOG.info("Failed to send message {} on channel {}", msg, channel, f.cause()); negotiationFailed(f.cause()); } else { - LOG.trace("Message {} sent to socket", msg); + LOG.trace("Message {} sent to socket on channel {}", msg, channel); } }); } @@ -314,7 +317,7 @@ public abstract class AbstractNetconfSessionNegotiator