Skip to content

Commit

Permalink
Merge pull request wildfly-extras#753 from spyrkob/Issue-750_duplicat…
Browse files Browse the repository at this point in the history
…ed_logs_with_debug

[wildfly-extras#750] Fix logging configuration to avoid duplicated logs when using --debug option
  • Loading branch information
spyrkob authored Sep 10, 2024
2 parents 01c68f4 + 8487c16 commit ff41cff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@
loggers=org.wildfly.prospero,com.networknt.schema,org.eclipse.aether.internal.impl

logger.org.wildfly.prospero.level=INFO
logger.org.wildfly.prospero.handlers=FILE
# networknt schema is very verbose at DEBUG level
logger.com.networknt.schema.level=INFO
logger.com.networknt.schema.handlers=FILE
# set to DEBUG for additional information on artifact resolution
logger.org.eclipse.aether.internal.impl.level=INFO
logger.org.eclipse.aether.internal.impl.handlers=FILE

# Root logger level
logger.level=INFO
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,10 @@ public static CommandLine createCommandLine(CliConsole console, String[] args, A
if (c instanceof PropertyConfigurator) {
LogContextConfiguration lcc = ((PropertyConfigurator) c).getLogContextConfiguration();
lcc.getLoggerConfiguration("org.wildfly.prospero").setLevel(Level.DEBUG.getName());
lcc.getLoggerConfiguration("org.wildfly.prospero").addHandlerName("CONSOLE");
lcc.getHandlerConfiguration("CONSOLE").setLevel(Level.DEBUG.getName());
if (!lcc.getLoggerConfiguration("").getHandlerNames().contains("CONSOLE")) {
lcc.getLoggerConfiguration("").addHandlerName("CONSOLE");
}
lcc.commit();
} else {
logger.warn("Cannot change logging level, using default.");
Expand Down

0 comments on commit ff41cff

Please sign in to comment.