[java] reduce log noise at FINE level#12866
Conversation
Codecov ReportAll modified lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #12866 +/- ##
=======================================
Coverage 56.51% 56.51%
=======================================
Files 86 86
Lines 5255 5255
Branches 187 187
=======================================
Hits 2970 2970
Misses 2098 2098
Partials 187 187 ☔ View full report in Codecov by Sentry. |
|
The changes made here, based on the motivation look good to me. |
|
So, for instance, we use This looks to see if the code is being run in debug mode (e.g. IntelliJ debugger), or if system properties are set — https://github.com/SeleniumHQ/selenium/blob/selenium-4.13.0/java/src/org/openqa/selenium/internal/Debug.java#L35 If those conditions are true, it automatically assigns the level for the logs to In some respects I like that it makes it easy to get logs. Telling users to add: Is easier than asking them to follow: https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/ But it's ... unexpected and a little creepy. I knew we were auto turning on more logging when the tests were run, I thought it was in our test code, not in Selenium itself. I can see wanting to debug my test code without having all the Selenium noise (especially when running via Server). But also, most Java devs aren't used to JUL, so we aren't doing the most common thing, either. Really we need to use |
|
Thank you for elaborating. I appreciate that. I understand this better and agree with you. Maybe we can track this as a separate issue. |
|
Thank you for explaining it in detail. I agree with your point here. Using it only for the test good makes sense I think. |
* [java] reduce log noise at FINE level * [java] log new session response as a capability if want shorter log messages * [java] log dump http exchange filter output at lower level * [java] always use truncation on new session responses
Description
W3CHttpResponseCodec.decode()&DumpHttpExchangeFilterlog level to FINERNEW_SESSIONresponses are parsed with Capabilities.toString()Motivation and Context
W3CHttpResponseCodec.decode&DumpHttpExchangeFilterdo not add much information and they destroy the logs.NEW_SESSIONresponse can have Base64 values; theCapabilitiesclasses have a complicated parser to truncate nested values that are > 100 characters. We should use that in the responses as well. I was going to put this behindwebdriver.remote.shorten_log_messagessystem property, but if you want the full values, people can switch toFINEST.So, this is the first time I realized we have
Debug.getDebugLogLevel().FINERmessages toINFOwhen anyone runs anything in debug mode. Really feels like we should let users do the more Java thing here. Who is this for? Why not just set the logging output for the user if they request it? Or set this in our tests instead of all of Selenium?selenium.webdriver.logger.level?FINER