X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=datarouter-node%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fdmaap%2Fdatarouter%2Fnode%2FNodeUtils.java;h=4601f99ce6fe55d4bb070d10091c540dd210836e;hb=refs%2Fchanges%2F51%2F78851%2F11;hp=d2ab80346c61a8649859db59791f198d47415def;hpb=0fa019897cb79de1def349b8fd0b660d1951681a;p=dmaap%2Fdatarouter.git diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java index d2ab8034..4601f99c 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/NodeUtils.java @@ -44,7 +44,6 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang3.StringUtils; -import org.apache.log4j.Logger; import org.onap.dmaap.datarouter.node.eelf.EelfMsgs; import org.slf4j.MDC; @@ -57,7 +56,6 @@ public class NodeUtils { private static EELFLogger eelfLogger = EELFManager.getInstance() .getLogger(NodeUtils.class); - private static Logger nodeUtilsLogger = Logger.getLogger("org.onap.dmaap.datarouter.node.NodeUtils"); private NodeUtils() { } @@ -99,7 +97,7 @@ public class NodeUtils { md.update(key.getBytes()); return (getAuthHdr(node, base64Encode(md.digest()))); } catch (Exception exception) { - nodeUtilsLogger + eelfLogger .error("Exception in generating Credentials for given node name:= " + exception.toString(), exception); return (null); @@ -122,14 +120,13 @@ public class NodeUtils { try (FileInputStream fileInputStream = new FileInputStream(ksfile)) { ks.load(fileInputStream, kspass.toCharArray()); } catch (IOException ioException) { - nodeUtilsLogger.error("IOException occurred while opening FileInputStream: " + ioException.getMessage(), + eelfLogger.error("IOException occurred while opening FileInputStream: " + ioException.getMessage(), ioException); return (null); } } catch (Exception e) { setIpAndFqdnForEelf("getCanonicalName"); eelfLogger.error(EelfMsgs.MESSAGE_KEYSTORE_LOAD_ERROR, ksfile, e.toString()); - nodeUtilsLogger.error("NODE0401 Error loading my keystore file + " + ksfile + " " + e.toString(), e); return (null); } return (getCanonicalName(ks)); @@ -164,7 +161,7 @@ public class NodeUtils { } } } catch (Exception e) { - nodeUtilsLogger.error("NODE0402 Error extracting my name from my keystore file " + e.toString(), e); + eelfLogger.error("NODE0402 Error extracting my name from my keystore file " + e.toString(), e.getMessage()); } return (null); } @@ -179,7 +176,7 @@ public class NodeUtils { try { return (InetAddress.getByName(ip).getAddress()); } catch (Exception exception) { - nodeUtilsLogger + eelfLogger .error("Exception in generating byte array for given IP address := " + exception.toString(), exception); } @@ -258,7 +255,7 @@ public class NodeUtils { MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress()); } catch (Exception exception) { - nodeUtilsLogger + eelfLogger .error("Exception in generating byte array for given IP address := " + exception.toString(), exception); } @@ -282,7 +279,7 @@ public class NodeUtils { MDC.put("InvocationId", invId); } - public static void sendResponseError(HttpServletResponse response, int errorCode, Logger intlogger) { + public static void sendResponseError(HttpServletResponse response, int errorCode, EELFLogger intlogger) { try { response.sendError(errorCode); } catch (IOException ioe) { @@ -302,7 +299,7 @@ public class NodeUtils { return true; }catch (IOException e){ - nodeUtilsLogger.error("NODE0403 " + file.toString() + " Not in gzip(gz) format: " + e.toString() + e); + eelfLogger.error("NODE0403 " + file.toString() + " Not in gzip(gz) format: " + e.toString() + e); return false; } }