summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunder Tattavarada <statta@att.com>2020-10-27 22:06:33 +0000
committerGerrit Code Review <gerrit@onap.org>2020-10-27 22:06:33 +0000
commit3e850031660af8c78ecbd0bf801e3ceb26f040a1 (patch)
tree31a01ac651902f6f3a2ea289ccf6f51f8d174a3e
parent341a13377a3670abe171bc14c846e9f54c57ded1 (diff)
parent68497017062350f49c0aa28d8a3cf79e9a77aa42 (diff)
Merge "Checking arguments for error logs"
-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);