Skip to content

Commit

Permalink
Merge pull request #1317 from michalvavrik/backport-log-duplication-1…
Browse files Browse the repository at this point in the history
….4.z

[1.4.z] Install JBobss log handlers just once
  • Loading branch information
mjurc committed Sep 14, 2024
2 parents a9f9441 + 68a11dc commit 07d5b45
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions quarkus-test-core/src/main/java/io/quarkus/test/logging/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,13 @@ public static void configure(ScenarioContext scenario) {

// Remove existing handlers
for (Handler handler : logger.getHandlers()) {
// we don't need QuarkusDelayedHandler,
// and it leads to log duplication when the 'java.util.logging.manager'
// system property is set to the 'org.jboss.logmanager.LogManager'
if (handler instanceof QuarkusDelayedHandler) {
// JBosss context is saved statically and when more tests are run inside module
// while org.jboss.logmanager.LogManager is installed we add a new handlers in addition to previous ones
// it's desirable to install only a new handlers according to test configuration
// QuarkusDelayedHandler is removed as it duplicates logs when JBoss log manager is installed
if (handler instanceof QuarkusDelayedHandler || handler instanceof ConsoleHandler
|| handler instanceof FileHandler) {
logger.removeHandler(handler);
break;
}
}

Expand Down

0 comments on commit 07d5b45

Please sign in to comment.