hollingsworthd / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
813 stars 142 forks source link

Driver still logs on console even if all settings are set to false #175

Open chbakouras opened 8 years ago

chbakouras commented 8 years ago

Settings settings = Settings.builder() .logWire(false) .logTrace(false) .logWarnings(false) .timezone(Timezone.AMERICA_NEWYORK).build();

With above settings the driver still logs everything. I have Spring boot as a dependency. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> Is there a solution for this issue? What i'm doing wrong?

hollingsworthd commented 8 years ago

I think it's something to do with the logging configuration and level in Spring Boot. But you can also try Settings.builder().logger(null)

hollingsworthd commented 8 years ago

There may be a bug here. Each instance is backed by a separate JRE process. Maybe the logging config isn't getting passed on if it's being set by system properties.

chbakouras commented 8 years ago

Settings.builder().logger(null) Solved the spam of apache http wire! So this solution sets a null logger in jBrowserDriver? It's the right way?

Spring boot uses slf4j and logback-classic.. So there is 2 binds of slf4j, and i can not properly configure it. I had tried to exclude all slf4j dependencies, tried to configure it with spring's configurations: logging.level.org.apache.commons.logging.simplelog.log.org.apache.http.wire=ERROR and logging.level.apache.http.wire=ERROR nothing seems to work..

hollingsworthd commented 8 years ago

It's the right way?

For now. It's a workaround. When this issue is closed/fixed ideally you'll be able to use a non-null logger or whatever you want and not be spammed by Apache wire logs.

Another workaround that would be better (to not have extraneous logs generated and ignored which is what's happening now) might be Settings.builder().javaOptions("-Dyour.logging.params=something", "-Danother.logging.param=somethingelse") which passes properties onto the child JRE process.