summaryrefslogtreecommitdiffstats
path: root/policy-utils/src/main/java
diff options
context:
space:
mode:
authorjhh <jorge.hernandez-herrero@att.com>2021-06-15 14:50:20 -0500
committerjhh <jorge.hernandez-herrero@att.com>2021-06-15 15:36:24 -0500
commitaf4398c19298f049079a178fe7f7db96da8cda8b (patch)
treec4b010f708da4c715db7a96ed28d094cf52b1a34 /policy-utils/src/main/java
parent0945bc95ad1eb147c1ddf3d2069ad9a531838649 (diff)
filter logging input data per sonar security issue
Issue-ID: POLICY-3289 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Iad22a581a6bd98e7e210162d30ec7741972669d2
Diffstat (limited to 'policy-utils/src/main/java')
-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();
}
}