diff options
author | Kishore Reddy Dwaram <kishore.reddy.dwaram@att.com> | 2020-09-25 16:45:02 -0400 |
---|---|---|
committer | Kishore Reddy Dwaram <kishore.reddy.dwaram@att.com> | 2020-09-25 16:45:13 -0400 |
commit | a8618399833e9e2c2cfdd214058234a1395f8361 (patch) | |
tree | 18d6ccbf962e8f191cd5163da2f39e96c7fd5202 /ecomp-sdk/epsdk-core | |
parent | 7dda2debf352c4d89c468963c971dc0fd257eec8 (diff) |
changes done to support logs format
Issue-ID: PORTAL-1008
Signed-off-by: Kishore Reddy Dwaram <kishore.reddy.dwaram@att.com>
Change-Id: I20f110c0fd48d7258f86f08501bad81244d3db20
Diffstat (limited to 'ecomp-sdk/epsdk-core')
4 files changed, 7 insertions, 13 deletions
diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java index b1a0b0b8..cc0fca29 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/conf/AppConfig.java @@ -112,8 +112,7 @@ public class AppConfig extends WebMvcConfigurerAdapter implements Configurable, * each log file type that logging has been started. */ private void initGlobalLocalContext() { - String appName = SystemProperties.getProperty(SystemProperties.APPLICATION_NAME); - logger.init(appName); + logger.init(); } /** diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java index 6a5fe469..8e21fd2c 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/logging/aspect/EELFLoggerAdvice.java @@ -37,7 +37,6 @@ */ package org.onap.portalsdk.core.logging.aspect; -import static com.att.eelf.configuration.Configuration.MDC_INSTANCE_UUID; import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN; import static com.att.eelf.configuration.Configuration.MDC_SERVER_IP_ADDRESS; import static com.att.eelf.configuration.Configuration.MDC_SERVICE_NAME; @@ -50,8 +49,6 @@ import java.util.UUID; import javax.servlet.http.HttpServletRequest; import org.onap.portalsdk.core.domain.User; -import org.onap.portalsdk.core.exception.SessionExpiredException; -import org.onap.portalsdk.core.logging.format.AlarmSeverityEnum; import org.onap.portalsdk.core.logging.format.AuditLogFormatter; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.logging.logic.LoggerProperties; @@ -113,10 +110,9 @@ public class EELFLoggerAdvice { } // Initialize Request defaults only for controller methods. - MDC.put(MDC_SERVICE_NAME, SystemProperties.getProperty(SystemProperties.APPLICATION_NAME)); + MDC.put(MDC_SERVICE_NAME, LoggerProperties.getPropertyValue(LoggerProperties.APP_NAME)); MDC.put(MDC_SERVER_FQDN, InetAddress.getLocalHost().getHostName()); MDC.put(MDC_SERVER_IP_ADDRESS, InetAddress.getLocalHost().getHostAddress()); - MDC.put(MDC_INSTANCE_UUID, LoggerProperties.getProperty(LoggerProperties.INSTANCE_UUID)); MDC.put(className + methodName + SystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); MDC.put(SystemProperties.METRICSLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); MDC.put(SystemProperties.AUDITLOG_BEGIN_TIMESTAMP, getCurrentDateTimeUTC()); @@ -207,7 +203,7 @@ public class EELFLoggerAdvice { if (MDC.get(SystemProperties.PARTNER_NAME) == null|| MDC.get(SystemProperties.PARTNER_NAME).isEmpty()){ MDC.put(SystemProperties.PARTNER_NAME, "Unknown"); } - MDC.put(MDC_SERVICE_NAME, SystemProperties.getProperty(SystemProperties.APPLICATION_NAME)); + MDC.put(MDC_SERVICE_NAME, LoggerProperties.getPropertyValue(LoggerProperties.APP_NAME)); MDC.put(SystemProperties.STATUS_CODE, result); diff --git a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java index 0ce15b77..d3827d95 100644 --- a/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java +++ b/ecomp-sdk/epsdk-core/src/main/java/org/onap/portalsdk/core/util/SystemProperties.java @@ -347,8 +347,8 @@ public class SystemProperties { * * @return Application name */ - public static String getApplicationName() { - return getProperty(APPLICATION_NAME); + public String getApplicationName() { + return getProperty(APPLICATION_NAME); } /** diff --git a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegateTest.java b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegateTest.java index 2d1187f9..0d0bea73 100644 --- a/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegateTest.java +++ b/ecomp-sdk/epsdk-core/src/test/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegateTest.java @@ -241,9 +241,8 @@ public class EELFLoggerDelegateTest { @Test public void initTest(){ EELFLoggerDelegate eelFLoggerDelegate = new EELFLoggerDelegate(getClass().getName()); - String appName = "PortalSDK"; - eelFLoggerDelegate.init(appName); - Assert.assertTrue(true); + eelFLoggerDelegate.init(); + Assert.assertTrue(true); } @Test |