Cleanup message logging in netconf handlers
[controller.git] / opendaylight / netconf / netconf-netty-util / src / main / java / org / opendaylight / controller / netconf / nettyutil / handler / NetconfMessageToXMLEncoder.java
index 8ce9411cbd9c00ecf31639301454ac1f871b3179..302e24e0614fafc16985b69d89445d4d0599e4aa 100644 (file)
@@ -46,7 +46,9 @@ public class NetconfMessageToXMLEncoder extends MessageToByteEncoder<NetconfMess
     @Override
     @VisibleForTesting
     public void encode(ChannelHandlerContext ctx, NetconfMessage msg, ByteBuf out) throws IOException, TransformerException {
-        LOG.trace("Sent to encode : {}", XmlUtil.toString(msg.getDocument()));
+        if (LOG.isTraceEnabled()) {
+            LOG.trace("Sent to encode : {}", XmlUtil.toString(msg.getDocument()));
+        }
 
         if (clientId.isPresent()) {
             Comment comment = msg.getDocument().createComment("clientId:" + clientId.get());