Redirecting Caught and Uncaught Exceptions to OSGI Console and Log File
[controller.git] / opendaylight / sal / yang-prototype / sal / sal-core-demo / src / main / java / org / opendaylight / controller / sal / demo / SALDemo.java
index fa0ea393ab4bcea4a3dba91395c6eac7e2d9660b..9e50059972cd96a477f926465c6dc53754a9e578 100644 (file)
@@ -15,7 +15,12 @@ import org.opendaylight.controller.sal.core.impl.BrokerImpl;
 import org.opendaylight.controller.sal.core.impl.NotificationModule;\r
 \r
 \r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
 public class SALDemo {\r
+    protected static final Logger logger = LoggerFactory\r
+        .getLogger(SALDemo.class);\r
 \r
     static BrokerImpl broker;\r
     static DemoProviderImpl provider;\r
@@ -81,7 +86,7 @@ public class SALDemo {
             }\r
         } catch (IOException e) {\r
 \r
-            e.printStackTrace();\r
+            logger.error("",e);\r
         }\r
     }\r
 \r