Skip to content

Commit

Permalink
[java] Added a check for intentionally existing loggers (#14754)
Browse files Browse the repository at this point in the history
Added a check for intentionally existing loggers

A check for the handlers property of the LogManager is added
as to ensure that intentionally existing loggers such as ones
defined in the logging.properties file are not overwritten

Fixes #14160

Co-authored-by: Viet Nguyen Duc <[email protected]>
Co-authored-by: Puja Jagani <[email protected]>
Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
4 people authored Dec 28, 2024
1 parent d1f9874 commit 16b0074
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions java/src/org/openqa/selenium/grid/log/LoggingOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public void configureLogging() {
return;
}

// Keep current loggers if they are being manually set
if (LogManager.getLogManager().getProperty("handlers") != null) return;

// Remove all handlers from existing loggers
LogManager logManager = LogManager.getLogManager();
Enumeration<String> names = logManager.getLoggerNames();
Expand Down

0 comments on commit 16b0074

Please sign in to comment.