diff options
author | Sunder Tattavarada <statta@att.com> | 2020-10-27 22:06:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-10-27 22:06:33 +0000 |
commit | 3e850031660af8c78ecbd0bf801e3ceb26f040a1 (patch) | |
tree | 31a01ac651902f6f3a2ea289ccf6f51f8d174a3e /ecomp-sdk | |
parent | 341a13377a3670abe171bc14c846e9f54c57ded1 (diff) | |
parent | 68497017062350f49c0aa28d8a3cf79e9a77aa42 (diff) |
Merge "Checking arguments for error logs"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-logger/src/main/java/org/onap/portalsdk/core/logging/logic/EELFLoggerDelegate.java | 19 |
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); |