Added logger 54/79354/4
authorJegadeesh Babu <jegabab1@in.ibm.com>
Thu, 28 Feb 2019 13:38:15 +0000 (19:08 +0530)
committerJoss Armstrong <joss.armstrong@ericsson.com>
Fri, 1 Mar 2019 11:42:05 +0000 (11:42 +0000)
Sonar fix

Issue-ID: APPC-1513
Change-Id: Ie6a28085288457b8bf8fea5c6d21313e61532f7c
Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java

index d08b451..16fb187 100644 (file)
@@ -6,6 +6,8 @@
  * ================================================================================
  * Copyright (C) 2017 Amdocs
  * =============================================================================
+ * Modifications Copyright (C) 2019 IBM
+ * =============================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
@@ -27,6 +29,8 @@ import org.apache.commons.io.filefilter.WildcardFileFilter;
 import org.onap.appc.simulator.client.RequestHandler;
 import org.onap.appc.simulator.client.impl.JsonRequestHandler;
 
+import com.att.eelf.configuration.EELFLogger;
+import com.att.eelf.configuration.EELFManager;
 import java.io.*;
 import java.nio.file.Path;
 import java.nio.file.Paths;
@@ -36,13 +40,13 @@ import java.util.List;
 import java.util.Properties;
 
 public class ClientRunner {
-
+    private static final EELFLogger LOG = EELFManager.getInstance().getLogger(ClientRunner.class);
     public static void main(String ... args) throws Exception {
         String folder = args[0];
         if (folder == null) {
             folder = System.getProperty("user.dir");
         }
-        System.out.println("== THR#" +Thread.currentThread().getId()+ " Reading files under the folder : " + folder);
+        LOG.info("== THR#" +Thread.currentThread().getId()+ " Reading files under the folder : " + folder);
 
         String inputType = args[1];
         if (inputType != null && !inputType.matches("JSON")) {
@@ -56,12 +60,12 @@ public class ClientRunner {
         int filesNum = 0;
         for (File source: sources) {
             reqHandler.proceedFile(source, log);
-            System.out.println("== THR#" +Thread.currentThread().getId()+ " File <" + source.getName() + "> processed.");
+            LOG.info("== THR#" +Thread.currentThread().getId()+ " File <" + source.getName() + "> processed.");
             ++filesNum;
         }
-        System.out.println("DONE with " + filesNum + " files under the folder : " + folder);
+        LOG.info("DONE with " + filesNum + " files under the folder : " + folder);
         Thread.sleep(30);
-        System.out.println("Shutdown ...");
+        LOG.info("Shutdown ...");
         reqHandler.shutdown(Boolean.parseBoolean(properties.getProperty("client.force.shutdown")));
 //        System.exit(0);
     }
@@ -79,7 +83,7 @@ public class ClientRunner {
             try {
                 prop.load(conf);
             } catch (IOException e) {
-                e.printStackTrace();
+                LOG.error("Error occured while reading the property file", e);
             }
         } else {
             try {