Skip to content

Commit

Permalink
Configure log LevelChangePropagator
Browse files Browse the repository at this point in the history
  • Loading branch information
AsamK committed Nov 8, 2023
1 parent e61f587 commit d351f64
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/org/asamk/signal/logging/LogConfigurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.classic.PatternLayout;
import ch.qos.logback.classic.jul.LevelChangePropagator;
import ch.qos.logback.classic.spi.Configurator;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.ConsoleAppender;
Expand Down Expand Up @@ -36,6 +37,9 @@ public static void setScrubSensitiveInformation(final boolean scrubSensitiveInfo

@Override
public ExecutionStatus configure(LoggerContext lc) {
lc.addListener(new LevelChangePropagator() {{
setContext(lc);
}});
final var rootLogger = lc.getLogger(Logger.ROOT_LOGGER_NAME);

final var defaultLevel = verboseLevel > 1 ? Level.ALL : verboseLevel > 0 ? Level.INFO : Level.WARN;
Expand Down

0 comments on commit d351f64

Please sign in to comment.