From af4398c19298f049079a178fe7f7db96da8cda8b Mon Sep 17 00:00:00 2001 From: jhh Date: Tue, 15 Jun 2021 14:50:20 -0500 Subject: filter logging input data per sonar security issue Issue-ID: POLICY-3289 Signed-off-by: jhh Change-Id: Iad22a581a6bd98e7e210162d30ec7741972669d2 --- .../main/java/org/onap/policy/drools/utils/logging/LoggerUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'policy-utils/src/main/java') 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(); } } -- cgit 1.2.3-korg