Reduce NETCONF device disconnect warnings
[netconf.git] / netconf / sal-netconf-connector / src / main / java / org / opendaylight / netconf / sal / connect / netconf / listener / NetconfDeviceCommunicator.java
index b6725d6231c3c6290deef4b37f0f66fee05daa0e..0f358273fb287347f052126e5ed8f20726306c7d 100644 (file)
@@ -11,6 +11,7 @@ import com.google.common.base.Strings;
 import com.google.common.util.concurrent.ListenableFuture;
 import com.google.common.util.concurrent.SettableFuture;
 import io.netty.util.concurrent.Future;
+import java.io.EOFException;
 import java.util.ArrayDeque;
 import java.util.ArrayList;
 import java.util.Iterator;
@@ -235,7 +236,11 @@ public class NetconfDeviceCommunicator
     public void onSessionDown(final NetconfClientSession session, final Exception exception) {
         // If session is already in closing, no need to call tearDown again.
         if (startClosing()) {
-            LOG.warn("{}: Session went down", id, exception);
+            if (exception instanceof EOFException) {
+                LOG.info("{}: Session went down: {}", id, exception.getMessage());
+            } else {
+                LOG.warn("{}: Session went down", id, exception);
+            }
             tearDown(null);
         }
     }