Skip to content

Commit

Permalink
[java] Ensure Selenium logging options are respected if java logging …
Browse files Browse the repository at this point in the history
…properties are not set (#15197)

Fixes #14160 and #15176
  • Loading branch information
pujagani authored Jan 31, 2025
1 parent 96331c5 commit a5b92a0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions java/src/org/openqa/selenium/grid/log/LoggingOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,14 @@ public void configureLogging() {
return;
}

// Keep current loggers if they are being manually set
if (LogManager.getLogManager().getProperty("handlers") != null) return;
String configClass = System.getProperty("java.util.logging.config.class");
String configFile = System.getProperty("java.util.logging.config.file");

// Check if the java logging config class or file is set. If so, give that priority.
// Else default to the Selenium logging and respect the Selenium logging options.
if (configClass != null || configFile != null) {
return;
}

// Remove all handlers from existing loggers
LogManager logManager = LogManager.getLogManager();
Expand Down

0 comments on commit a5b92a0

Please sign in to comment.