Skip to content

Commit 5b18b33

Browse files
pujaganisandeepsuryaprasad
authored andcommitted
[java] Ensure Selenium logging options are respected if java logging properties are not set (SeleniumHQ#15197)
Fixes SeleniumHQ#14160 and SeleniumHQ#15176
1 parent 5bd6952 commit 5b18b33

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

java/src/org/openqa/selenium/grid/log/LoggingOptions.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,14 @@ public void configureLogging() {
9898
return;
9999
}
100100

101-
// Keep current loggers if they are being manually set
102-
if (LogManager.getLogManager().getProperty("handlers") != null) return;
101+
String configClass = System.getProperty("java.util.logging.config.class");
102+
String configFile = System.getProperty("java.util.logging.config.file");
103+
104+
// Check if the java logging config class or file is set. If so, give that priority.
105+
// Else default to the Selenium logging and respect the Selenium logging options.
106+
if (configClass != null || configFile != null) {
107+
return;
108+
}
103109

104110
// Remove all handlers from existing loggers
105111
LogManager logManager = LogManager.getLogManager();

0 commit comments

Comments
 (0)