Skip to content

Commit

Permalink
Fix double override log lone
Browse files Browse the repository at this point in the history
  • Loading branch information
tgracchus committed May 2, 2024
1 parent 285b519 commit 586f4b3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/com/hivemq/bootstrap/LoggingBootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ public static void initLogging(final @NotNull File configFolder) {
if (!overridden) {
reEnableDefaultAppenders();
context.addTurboFilter(LOG_LEVEL_MODIFIER_TURBO_FILTER);
logQueuedEntries();
}

redirectJULToSLF4J();
logQueuedEntries();

reset();
// must be added here, as addLoglevelModifiers() is much to late
Expand Down Expand Up @@ -164,9 +165,7 @@ private static boolean tryToOverrideLogbackXml(final @NotNull File configFolder)
final JoranConfigurator configurator = new JoranConfigurator();
configurator.setContext(context);
configurator.doConfigure(file);

LIST_APPENDER.start();
context.getLogger(Logger.ROOT_LOGGER_NAME).addAppender(LIST_APPENDER);
logQueuedEntries();
log.info("Log Configuration was overridden by {}", file.getAbsolutePath());
return true;
} catch (final JoranException je) {
Expand Down

0 comments on commit 586f4b3

Please sign in to comment.