diff --git a/java/src/org/openqa/selenium/grid/log/LoggingOptions.java b/java/src/org/openqa/selenium/grid/log/LoggingOptions.java index 60b3a96ca9cc6..bbe976f9f105f 100644 --- a/java/src/org/openqa/selenium/grid/log/LoggingOptions.java +++ b/java/src/org/openqa/selenium/grid/log/LoggingOptions.java @@ -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();