From 428104bdf01fb811d12c6dc17489d1d01122400a Mon Sep 17 00:00:00 2001 From: Gleb Date: Thu, 8 Feb 2024 13:29:55 -0800 Subject: [PATCH] Fix log level bug --- .../platform/configurator/SpringFrameworkConfigurator.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/src/main/java/org/stellar/anchor/platform/configurator/SpringFrameworkConfigurator.java b/platform/src/main/java/org/stellar/anchor/platform/configurator/SpringFrameworkConfigurator.java index 06e5a92e8..09d0cd16d 100644 --- a/platform/src/main/java/org/stellar/anchor/platform/configurator/SpringFrameworkConfigurator.java +++ b/platform/src/main/java/org/stellar/anchor/platform/configurator/SpringFrameworkConfigurator.java @@ -15,11 +15,12 @@ public void initialize(@NotNull ConfigurableApplicationContext applicationContex PropertiesPropertySource pps = createPrefixedPropertySource("spring"); pps.getSource() .forEach( - (String k, Object v) -> { - if (k.startsWith("logging.level")) { + (String cfgName, Object cfgValue) -> { + if (cfgName.startsWith("logging.level") && cfgValue instanceof String) { LoggingSystem system = LoggingSystem.get(SpringFrameworkConfigurator.class.getClassLoader()); - system.setLogLevel(k.replace("logging.level.", ""), LogLevel.valueOf((String) v)); + system.setLogLevel( + cfgName.replace("logging.level.", ""), LogLevel.valueOf((String) cfgValue)); } }); applicationContext.getEnvironment().getPropertySources().addFirst(pps);