Skip to content

Commit

Permalink
Fix log level bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ifropc committed Feb 8, 2024
1 parent c3b82a6 commit 428104b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 428104b

Please sign in to comment.