Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.4.z] Install JBobss log handlers just once #1317

Merged
merged 1 commit into from
Sep 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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