Selenium WebDriver generates too much log info

1,526 views
Skip to first unread message

Георгий Асафьев

unread,
Aug 17, 2015, 1:18:55 AM8/17/15
to Selenium Users
I have an issue using Selenium WebDriver with Robot Framework through jrobotremoteserver.
Report contains tons of log messages like following:
16:59:14.746 [Forwarding findElement on session fd4127e7-b651-433c-aef2-a45e744c2a07 to remote] DEBUG o.a.h.c.protocol.RequestAddCookies - CookieSpec selected: best-match
16:59:14.746 [Forwarding findElement on session fd4127e7-b651-433c-aef2-a45e744c2a07 to remote] DEBUG o.a.h.c.protocol.RequestAuthCache - Auth cache not set in the context
16:59:14.746 [Forwarding findElement on session fd4127e7-b651-433c-aef2-a45e744c2a07 to remote] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection request: [route: {}->http://127.0.0.1:7055][total kept alive: 0; route allocated: 0 of 2000; total allocated: 0 of 2000]
16:59:14.746 [Forwarding findElement on session fd4127e7-b651-433c-aef2-a45e744c2a07 to remote] DEBUG o.a.h.i.c.PoolingHttpClientConnectionManager - Connection leased: [id: 37][route: {}->http://127.0.0.1:7055][total kept alive: 0; route allocated: 1 of 2000; total allocated: 1 of 2000]
...
I would like to turn off this logs.
I've tried many things like:
LoggingPreferences logs = new LoggingPreferences();
logs.enable(LogType.BROWSER, Level.OFF);
logs.enable(LogType.CLIENT, Level.OFF);
logs.enable(LogType.DRIVER, Level.OFF);
logs.enable(LogType.PERFORMANCE, Level.OFF);
logs.enable(LogType.PROFILER, Level.OFF);
logs.enable(LogType.SERVER, Level.OFF);
DesiredCapabilities desiredCapabilities = DesiredCapabilities.firefox();
desiredCapabilities.setCapability(CapabilityType.LOGGING_PREFS, logs);
driver = new FirefoxDriver(desiredCapabilities);


and even like:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("webdriver.log.browser.file", "/dev/null");
profile.setPreference("webdriver.log.browser.ignore", "True");
profile.setPreference("webdriver.log.driver.ignore", "True");
profile.setPreference("webdriver.log.profiler.ignore", "True");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(caps);

But logs are still there... Can anyone help me, please?




Krishnan Mahadevan

unread,
Aug 17, 2015, 1:45:16 AM8/17/15
to Selenium Users
Looks like you are having a logging.properties (or) a log4j.properties that has turned on DEBUG level logs at the root level.
I would first start looking from there.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0b977a69-739d-4096-8858-69d0c7eaa84b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Георгий Асафьев

unread,
Aug 17, 2015, 8:28:55 AM8/17/15
to Selenium Users
Hi, Krishnan!

What do you mean by "root level"? I have no logging.properties or log4j.properties in my project. If this files present in imported libraries can it affect my project? How can i override this logging preferences? I have tried to put log4j.properties in my source root folder and seems that it doesn't work. Thanks in advance!

понедельник, 17 августа 2015 г., 8:45:16 UTC+3 пользователь Krishnan написал:

Krishnan Mahadevan

unread,
Aug 17, 2015, 10:32:01 PM8/17/15
to Selenium Users
I haven't played around too much on the logging part of WebDriver. WebDriver makes use of Java Utils logger. So you should be able to provide a logging.properties

That said, I dont think the output is coming due to a presence of a logging.properties/log4j.properties in the selenium artifacts. 

I believe it could be perhaps via the jrobotremoteserver. I dont know much about this library. So you may have to dig in yourself or reach out to a relevant forum.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Максим Ринг

unread,
Jul 19, 2018, 4:00:03 AM7/19/18
to Selenium Users
BTW this may help https://stackoverflow.com/questions/4915414/disable-httpclient-logging/8936580#8936580

понедельник, 17 августа 2015 г., 8:18:55 UTC+3 пользователь Георгий Асафьев написал:

Максим Ринг

unread,
Jul 19, 2018, 4:00:03 AM7/19/18
to Selenium Users
Hello, having same issue, if you have found solution can you please post it here. Thank you.


понедельник, 17 августа 2015 г., 8:18:55 UTC+3 пользователь Георгий Асафьев написал:
I have an issue using Selenium WebDriver with Robot Framework through jrobotremoteserver.

pierre....@datameer.com

unread,
Jul 19, 2018, 10:20:17 PM7/19/18
to Selenium Users
In Ruby there is a static Property from the Webdriver which controls the global loglevel. We set it to:
Selenium::WebDriver.logger.level = :warn

which solved the issue.

Максим Ринг

unread,
Jul 20, 2018, 10:25:23 AM7/20/18
to Selenium Users
I have solve my problem by excluding some packages in maven
<exclusions>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
</exclusions>


пятница, 20 июля 2018 г., 5:20:17 UTC+3 пользователь pierre....@datameer.com написал:

total-qa

unread,
Jul 23, 2018, 6:59:52 AM7/23/18
to Selenium Users
Switch off the logs using the following command.

Anybody now how to stop Marionette/GeckoDriver from spewing out MASSIVE amounts of INFO and DEBUG messages to the Console?

 

Try this Following Command:

System.setProperty(FirefoxDriver.SystemProperty.BROWSER_LOGFILE,“null");



Regards,
Reply all
Reply to author
Forward
0 new messages