Redirecting Caught and Uncaught Exceptions to OSGI Console and Log File
[controller.git] / opendaylight / forwarding / staticrouting / src / main / java / org / opendaylight / controller / forwarding / staticrouting / StaticRoute.java
index beec70e5ca54f9d3eda9b944a416c93e08b5727a..3cf45b11c8246fd9ab4c2d8e2feb9fc1c58507cf 100644 (file)
@@ -22,11 +22,16 @@ import org.opendaylight.controller.sal.utils.NodeConnectorCreator;
 import org.opendaylight.controller.sal.utils.NodeCreator;
 
 import org.opendaylight.controller.hosttracker.hostAware.HostNodeConnector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This class defines a static route object.
  */
 public class StaticRoute {
+    protected static final Logger logger = LoggerFactory
+    .getLogger(StaticRoute.class);
+
     /**
      * This Enum defines the possible types for the next hop address.
      */
@@ -249,7 +254,7 @@ public class StaticRoute {
             return InetAddress.getByAddress(BitBufferHelper
                     .toByteArray(netmask));
         } catch (Exception e) {
-            e.printStackTrace();
+            logger.error("",e);
             return null;
         }
     }
@@ -282,7 +287,7 @@ public class StaticRoute {
                 try {
                     return InetAddress.getByAddress(bbself.array());
                 } catch (Exception e) {
-                    e.printStackTrace();
+                    logger.error("",e);
                 }
             }
         }