Redirecting Caught and Uncaught Exceptions to OSGI Console and Log File
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / FlowConverter.java
index 47ce283331c0bbe6b29fe6a231761656fdcb7728..6379b5d74e15980b18bab06d06f1e8793cbcbf0e 100644 (file)
@@ -67,11 +67,15 @@ import org.opendaylight.controller.sal.match.MatchField;
 import org.opendaylight.controller.sal.match.MatchType;
 import org.opendaylight.controller.sal.utils.NetUtils;
 import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Utility class for converting a SAL Flow into the OF flow and vice-versa
  */
 public class FlowConverter {
+    protected static final Logger logger = LoggerFactory
+    .getLogger(FlowConverter.class);
     private Flow flow; // SAL Flow
     private OFMatch ofMatch; // OF 1.0 match or OF 1.0 + IPv6 extension match
     private List<OFAction> actionsList; // OF 1.0 actions
@@ -680,7 +684,7 @@ public class FlowConverter {
                         try {
                             ip = InetAddress.getByAddress(addr);
                         } catch (UnknownHostException e) {
-                            e.printStackTrace();
+                            logger.error("",e);
                         }
                         salAction = new SetNwSrc(ip);
                     } else if (ofAction instanceof OFActionNetworkLayerDestination) {
@@ -691,7 +695,7 @@ public class FlowConverter {
                         try {
                             ip = InetAddress.getByAddress(addr);
                         } catch (UnknownHostException e) {
-                            e.printStackTrace();
+                            logger.error("",e);
                         }
                         salAction = new SetNwDst(ip);
                     } else if (ofAction instanceof OFActionNetworkTypeOfService) {
@@ -718,4 +722,4 @@ public class FlowConverter {
         return flow;
     }
 
-}
\ No newline at end of file
+}