summaryrefslogtreecommitdiffstats
path: root/policy-utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'policy-utils/src')
-rw-r--r--policy-utils/src/main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/policy-utils/src/main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java b/policy-utils/src/main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java
index 60867528..b5e60679 100644
--- a/policy-utils/src/main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java
+++ b/policy-utils/src/main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java
@@ -86,7 +86,9 @@ public class LoggerUtil {
throw new IllegalArgumentException("no logger " + loggerName);
}
- logger.setLevel(ch.qos.logback.classic.Level.toLevel(loggerLevel));
+ // use the current log level if the string provided cannot be converted to a valid Level.
+ logger.setLevel(ch.qos.logback.classic.Level.toLevel(loggerLevel, logger.getLevel()));
+
return logger.getLevel().toString();
}
}