Remove datarouter-node critical code smells
[dmaap/datarouter.git] / datarouter-node / src / main / java / org / onap / dmaap / datarouter / node / NodeMain.java
index 7ff33ff..7a2691e 100644 (file)
@@ -23,7 +23,9 @@
 
 package org.onap.dmaap.datarouter.node;
 
-import org.apache.log4j.Logger;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 import org.eclipse.jetty.http.HttpVersion;
 import org.eclipse.jetty.server.*;
 import org.eclipse.jetty.servlet.FilterHolder;
@@ -46,7 +48,7 @@ public class NodeMain {
     private NodeMain() {
     }
 
-    private static Logger nodeMainLogger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeMain");
+    private static EELFLogger nodeMainLogger = EELFManager.getInstance().getLogger(NodeMain.class);
 
     class Inner {
         InputStream getCadiProps() {
@@ -54,7 +56,7 @@ public class NodeMain {
             try {
                 in = getClass().getClassLoader().getResourceAsStream("drNodeCadi.properties");
             } catch (Exception e) {
-                nodeMainLogger.error("Exception in Inner.getCadiProps() method " + e.getMessage());
+                nodeMainLogger.error("Exception in Inner.getCadiProps() method ", e);
             }
             return in;
         }
@@ -80,7 +82,7 @@ public class NodeMain {
                     wait();
                 } catch (Exception exception) {
                     nodeMainLogger
-                            .debug("NodeMain: waitForConfig exception. Exception Message:- " + exception.toString(),
+                            .error("NodeMain: waitForConfig exception. Exception Message:- " + exception.toString(),
                                     exception);
                 }
             }
@@ -179,7 +181,7 @@ public class NodeMain {
                         InputStream in = obj.getCadiProps();
                         cadiProperties.load(in);
                     } catch (IOException e1) {
-                        nodeMainLogger.error("NODE00005 Exception in NodeMain.Main() loading CADI properties " + e1.getMessage());
+                        nodeMainLogger.error("NODE00005 Exception in NodeMain.Main() loading CADI properties ", e1);
                     }
                     cadiProperties.setProperty("aaf_locate_url", nodeConfigManager.getAafURL());
                     nodeMainLogger.info("NODE00005  aaf_url set to - " + cadiProperties.getProperty("aaf_url"));