selenium: [šŸ› Bug]: Can't display SeleniumManager logs at any level when switching from 4.12.0 to 4.12.1

What happened?

I’ve found a strange behavior about this log change switching from 4.12.0 to 4.12.1, it’s like nothing is logged at any level in 4.12.1 (probably related to https://github.com/SeleniumHQ/selenium/pull/12673)

I’m using a jul-to-slf4j conversion which works perfecty until 4.12.0, but no more logs in 4.12.1

Using a ā€œTRACEā€ log level which includes FINEST, FINER and FINE :

FINEST -> TRACE FINER -> DEBUG FINE -> DEBUG INFO -> INFO WARNING -> WARN SEVERE -> ERROR

logback.xml : <logger name="org.openqa.selenium.manager" level="TRACE" />

Using selenium-java 4.12.0, I see this :

12:08:36.961 [Timer-0] INFO  o.o.selenium.manager.SeleniumManager - Driver path: C:\Users\PC\.cache\selenium\chromedriver\win64\116.0.5845.96\chromedriver.exe
12:08:36.962 [Timer-0] INFO  o.o.selenium.manager.SeleniumManager - Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

when upgrading to 4.12.1, I see no SeleniumManager log when I would expect to see :

12:08:36.961 [Timer-0] DEBUG  o.o.selenium.manager.SeleniumManager - Driver path: C:\Users\PC\.cache\selenium\chromedriver\win64\116.0.5845.96\chromedriver.exe
12:08:36.962 [Timer-0] DEBUG  o.o.selenium.manager.SeleniumManager - Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe

after this change : https://github.com/SeleniumHQ/selenium/pull/12673

Switching back to 4.12.0 (with no other change) restores the logs.

How can we reproduce the issue?

To reproduce, just try to display SeleniumManager logs from a calling program having this dependency :

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>4.12.0</version>
        </dependency>

Then upgrade to 4.12.1 and see the logs are no more displayed.

Relevant log output

12:08:36.961 [Timer-0] INFO  o.o.selenium.manager.SeleniumManager - Driver path: C:\Users\PC\.cache\selenium\chromedriver\win64\116.0.5845.96\chromedriver.exe
12:08:36.962 [Timer-0] INFO  o.o.selenium.manager.SeleniumManager - Browser path: C:\Program Files\Google\Chrome\Application\chrome.exe


### Operating System

Windows 10

### Selenium version

4.12.1

### What are the browser(s) and version(s) where you see this issue?

Pb in SeleniumManager, present for all browsers and all versions

### What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 116.0.5845.96

### Are you using Selenium Grid?

no

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

Oups, here is a few more precise hints/steps if u need :

  • Add these dependencies to your client project : image
  • Activate the ā€œbridgeā€ mechanism as explain here (I copy/paste the ā€œProgrammatic installationā€ lines).
  • Now the little trick : add java.util.logging.LogManager.getLogManager().getLogger("").setLevel(Level.FINE); right after SLF4JBridgeHandler.install(); to make all ā€œjava.util.loggingā€ logs available to the ā€œbridgeā€ mechanism

From there, you can configure logs in ā€œlogback.xmlā€ to be placed in src/main/resources, basic example :

<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <logger name="org.openqa.selenium.manager" level="INFO" />

    <root level="INFO">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

P.S. : I’m not saying it’s ā€œeasierā€ than what you provide, but it has been the way to configure logs in java since the creation of ā€œlog4jā€ 20+ years ago, and it has not changed much, so once u know how it works, u can reuse it forever, for any java project… 😃