diff options
author | Nandkishor Patke <nandkishor-laxman.patke@t-systems.com> | 2024-04-06 02:34:35 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2024-04-06 02:34:35 +0000 |
commit | ebb52fd8fa205c730c3ee19e9ee33dac8cde3c20 (patch) | |
tree | 6ab30c0e45be223d47393040edfa7ed891bdac71 /eelf-logging/src/main/java | |
parent | 6ad29c2d9910a0fc105f2c979c1beb1c759cc7a5 (diff) | |
parent | df73577f01e131fb0638e7d5ae3a85217975e9e9 (diff) |
Merge "Update eelf-core in logging-service"
Diffstat (limited to 'eelf-logging/src/main/java')
3 files changed, 7 insertions, 19 deletions
diff --git a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/AaiLoggerAdapter.java b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/AaiLoggerAdapter.java index 25ab5ee..fde9ab0 100644 --- a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/AaiLoggerAdapter.java +++ b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/AaiLoggerAdapter.java @@ -22,7 +22,7 @@ package org.onap.aai.cl.eelf; import com.att.eelf.configuration.EELFLogger; import com.att.eelf.configuration.EELFLogger.Level; -import com.att.eelf.i18n.EELFResolvableErrorEnum; +import com.att.eelf.i18n.EELFResolvableResourceEnum; import com.att.eelf.i18n.EELFResourceManager; import org.onap.aai.cl.api.LogFields; import org.onap.aai.cl.api.LogLine; @@ -336,7 +336,7 @@ public class AaiLoggerAdapter implements Logger { @Override public String formatMsg(Enum logCode, String... arguments) { - return EELFResourceManager.getMessage((EELFResolvableErrorEnum) logCode, arguments); + return EELFResourceManager.getMessage((EELFResolvableResourceEnum) logCode, arguments); } private LogLine getLogLine() { diff --git a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LogMessageEnum.java b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LogMessageEnum.java index 6bfe41b..3373537 100644 --- a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LogMessageEnum.java +++ b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LogMessageEnum.java @@ -20,12 +20,11 @@ */ package org.onap.aai.cl.eelf; -import com.att.eelf.i18n.EELFResolvableErrorEnum; -import com.att.eelf.i18n.EELFResourceManager; +import com.att.eelf.i18n.EELFResolvableResourceEnum; /** This is a placeholder which client-specific message key enumerations should * implement in order to tie into the log template functionality of the EELF * framework. */ -public interface LogMessageEnum extends EELFResolvableErrorEnum { +public interface LogMessageEnum extends EELFResolvableResourceEnum { } diff --git a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LoggerFactory.java b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LoggerFactory.java index bd6b8d0..a31b859 100644 --- a/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LoggerFactory.java +++ b/eelf-logging/src/main/java/org/onap/aai/cl/eelf/LoggerFactory.java @@ -37,11 +37,6 @@ public class LoggerFactory implements LoggerFactoryInterface { /** The instance for our factory singleton. */ private static LoggerFactory instance; - /** An instance of the log factory provided by the EELF framework. We will use - * this to get an actual EELF logger instance that we will wrap within our - * own, more generalized logger. */ - private EELFManager eelfManager; - /** This cache maintains a mapping of logger names to instances so that if a * logger with the same name is requested multiple times we can return the * same instance each time. */ @@ -76,12 +71,6 @@ public class LoggerFactory implements LoggerFactoryInterface { */ protected LoggerFactory() { - // We need an instance of the factory provided by the EELF - // framework so that we can instantiate the EELF logger that - // we will be wrapping, so get one now. - if (eelfManager == null) { - eelfManager = EELFManager.getInstance(); - } } /** @@ -96,7 +85,7 @@ public class LoggerFactory implements LoggerFactoryInterface { if (!errorLoggerCache.containsKey(name)) { // Nothing in the cache, so let's instantiate a logger now. - Logger logger = new AaiLoggerAdapter(eelfManager.getLogger(name), LogLineType.ERROR, name); + Logger logger = new AaiLoggerAdapter(EELFManager.getLogger(name), LogLineType.ERROR, name); errorLoggerCache.put(name, logger); } @@ -126,7 +115,7 @@ public class LoggerFactory implements LoggerFactoryInterface { if (!auditLoggerCache.containsKey(name)) { // Nothing in the cache, so let's instantiate a logger now. - Logger logger = new AaiLoggerAdapter(eelfManager.getAuditLogger(), LogLineType.AUDIT, name); + Logger logger = new AaiLoggerAdapter(EELFManager.getAuditLogger(), LogLineType.AUDIT, name); auditLoggerCache.put(name, logger); } @@ -156,7 +145,7 @@ public class LoggerFactory implements LoggerFactoryInterface { if (!metricLoggerCache.containsKey(name)) { // Nothing in the cache, so let's instantiate a logger now. - Logger logger = new AaiLoggerAdapter(eelfManager.getMetricsLogger(), LogLineType.METRICS, + Logger logger = new AaiLoggerAdapter(EELFManager.getMetricsLogger(), LogLineType.METRICS, name); metricLoggerCache.put(name, logger); } |