summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java b/ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java
index f74571b5..64ca1ab1 100644
--- a/ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java
+++ b/ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java
@@ -135,13 +135,18 @@ public class EELFLoggerDelegate extends SLF4jWrapper implements EELFLogger {
}
if (logger.isErrorEnabled()) {
- Object[] transformedArgs = Arrays.stream(arguments).map(argument -> {
- if (argument instanceof Throwable)
- return ((Throwable) argument).getMessage();
- else
- return argument;
- }).toArray();
- logger.log(level, msg, null, transformedArgs);
+ Object[] transformedArgs = null;
+ if (arguments != null) {
+ transformedArgs = Arrays.stream(arguments).map(argument -> {
+ if (argument instanceof Throwable)
+ return ((Throwable) argument).getMessage();
+ else
+ return argument;
+ }).toArray();
+ logger.log(level, msg, null, transformedArgs);
+ } else {
+ logger.log(level, msg, null);
+ }
debugLogger.error(msg, arguments);
} else {
logger.log(level, msg, th, arguments);