diff options
author | Jegadeesh Babu <jegabab1@in.ibm.com> | 2019-02-28 19:08:15 +0530 |
---|---|---|
committer | Joss Armstrong <joss.armstrong@ericsson.com> | 2019-03-01 11:42:05 +0000 |
commit | a9128f1964d43842056ea72dc1f0a8f3702cc03c (patch) | |
tree | 3fc6b835577baf2d6a7c7a32e0d3e2fee3884bc7 | |
parent | 376d65c71a373060fc31023cbd42d0751ee0c3a8 (diff) |
Added logger
Sonar fix
Issue-ID: APPC-1513
Change-Id: Ie6a28085288457b8bf8fea5c6d21313e61532f7c
Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
-rw-r--r-- | appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java index d08b451a5..16fb1872e 100644 --- a/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java +++ b/appc-client/client-simulator/src/main/java/org/onap/appc/simulator/client/main/ClientRunner.java @@ -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 { |