Lower logger level in OF1.0 Discovery Service 60/5160/1
authorAlessandro Boch <aboch@cisco.com>
Fri, 7 Feb 2014 00:40:09 +0000 (16:40 -0800)
committerAlessandro Boch <aboch@cisco.com>
Fri, 7 Feb 2014 01:54:19 +0000 (17:54 -0800)
- Discovery Service has a function to attempt to snoop
  non controller generated or malformed LLDP frames.
  The whole function block is in a try catch block,
  as exceptions are well expected.
  In case an exception is hit though, the function logs
  it as a warn.
- Change the log level to debug, do not print a stack trace,
  print the source MAC and the port on which it was received.

Change-Id: I82b459b16356b0a57934b3c26c993d20a2b53dc2
Signed-off-by: Alessandro Boch <aboch@cisco.com>
opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/DiscoveryService.java

index 394be07dee2968b838377d8424ad8c70d49f4bce..b29ce15f5621aa0c09b29bafdf080448b973b628 100644 (file)
@@ -391,7 +391,12 @@ public class DiscoveryService implements IInventoryShimExternalListener, IDataPa
 
             updateProdEdge(edge, props);
         } catch (Exception e) {
 
             updateProdEdge(edge, props);
         } catch (Exception e) {
-            logger.warn("Caught exception ", e);
+            if (logger.isDebugEnabled()) {
+                logger.debug(
+                        "Caught exception while attempting to snoop non controller generated or malformed LLDP frame sent by {} and received on {}: {}",
+                        HexEncode.bytesToHexStringFormat(ethPkt.getSourceMACAddress()), dstNodeConnector,
+                        e.getMessage());
+            }
         }
     }
 
         }
     }