From d85bbade599e86c29286e0b4279c811bd83638c6 Mon Sep 17 00:00:00 2001 From: "r.bogacki" Date: Mon, 11 Mar 2019 10:23:52 +0100 Subject: Cleaned up MsoLogger class Removed setServiceName method from MsoLogger. Cleaned up unused methods from MsoLogger. Change-Id: I1fe033ed25dda32c07693a5087bf65de3ecc229c Issue-ID: LOG-631 Signed-off-by: Robert Bogacki --- .../main/java/org/onap/so/logger/MsoLogger.java | 80 +--------------------- 1 file changed, 2 insertions(+), 78 deletions(-) (limited to 'common/src/main') diff --git a/common/src/main/java/org/onap/so/logger/MsoLogger.java b/common/src/main/java/org/onap/so/logger/MsoLogger.java index 39a23b5c3e..341d7996a9 100644 --- a/common/src/main/java/org/onap/so/logger/MsoLogger.java +++ b/common/src/main/java/org/onap/so/logger/MsoLogger.java @@ -96,12 +96,6 @@ public class MsoLogger { public static final String PARTNER_NAME = "PartnerName"; - - - - - - // Audit/Metric log specific public static final String BEGINTIME = "BeginTimestamp"; public static final String STARTTIME = "StartTimeMilis"; @@ -184,9 +178,7 @@ public class MsoLogger { this.value = value; } } - - public static final Marker ENTRY = MarkerFactory.getMarker("ENTRY"); - public static final Marker EXIT = MarkerFactory.getMarker("EXIT"); + private Logger logger; private Logger metricsLogger; @@ -194,9 +186,6 @@ public class MsoLogger { private static String instanceUUID, serverIP, serverName; private MessageEnum exceptionArg, defaultException, defaultWarning, defaultAudit, defaultMetrics; - // For internal logging of the initialization of MSO logs - private static final Logger initLOGGER = LoggerFactory.getLogger(MsoLogger.class.getName()); - private MsoLogger() { this(MsoLogger.Catalog.GENERAL); } @@ -236,12 +225,6 @@ public class MsoLogger { * @param targetVEntity * Target VNF or VM acted opon by the component, if available */ - public void recordMetricEvent() { - metricsLogger.info(""); - MDC.remove(TIMER); - MDC.remove(TARGETENTITY); - MDC.remove(TARGETSERVICENAME); - } public void recordMetricEvent(Long startTime, StatusCode statusCode, ResponseCode responseCode, String responseDesc, String targetEntity, String targetServiceName, String targetVEntity) { @@ -266,10 +249,7 @@ public class MsoLogger { * @param responseDesc * Human redable description of the application response code */ - public void recordAuditEvent(){ - auditLogger.info(""); - } - + public void recordAuditEvent(Long startTime, StatusCode statusCode, ResponseCode responseCode, String responseDesc) { if (StringUtils.isEmpty(MDC.get(MsoLogger.PARTNERNAME))) { @@ -1060,15 +1040,6 @@ public class MsoLogger { return classArr[0].getMethodName(); } - // Based on the discussion with Adrian, instanceUUID is used to identifiy - // the mso instance, - // it is generated during mso instance initialization period - // The same mso instnace will use the same instanceUUID value, even after - // restart - private static String getInstanceUUID() { - return System.getProperty("mso-instance-id"); - } - /** * Set the requestId and serviceInstanceId * @@ -1087,36 +1058,6 @@ public class MsoLogger { } } - /** - * Set the remoteIp and the basic HTTP Authentication user - * - * @param remoteIpp - * The remote ip address - * @param userp - * The basic http authencitation user - */ - public static void setLoggerParameters(String remoteIpp, String userp) { - if (null != remoteIpp) { - MDC.put(REMOTE_HOST, remoteIpp); - } - if (null != userp) { - MDC.put(USER, userp); - } - } - - /** - * Set the serviceName - * - * @param serviceNamep - * The service name - */ - public static void setServiceName(String serviceNamep) { - if (null != serviceNamep) { - MDC.put(SERVICE_NAME, serviceNamep); - MDC.remove(SERVICE_NAME_IS_METHOD_NAME); - } - } - /** * Get the serviceName * @@ -1126,13 +1067,6 @@ public class MsoLogger { return MDC.get(SERVICE_NAME); } - /** - * Reset the serviceName - */ - public static void resetServiceName() { - MDC.remove(SERVICE_NAME); - } - /** * Set the requestId and serviceInstanceId based on the mso request * @@ -1191,14 +1125,4 @@ public class MsoLogger { defaultMetrics = MessageEnum.GENERAL_METRICS; } } - - public void warnSimple(String message, Exception e) { - logger.warn(message,e); - - } - - - - - } -- cgit 1.2.3-korg