-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do not disable Google HTTP Client logging for custom logger in Gradle #2357
Conversation
Travis seems to have completely stalled. Will try closing and reopening. |
// https://github.com/GoogleContainerTools/jib/issues/2356 | ||
if (System.getProperty("java.util.logging.config.file") == null) { | ||
// Disables Google HTTP client logging. | ||
java.util.logging.Logger.getLogger(HttpTransport.class.getName()).setLevel(Level.OFF); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand how this solves the problem? Does gradle have it's own custom logger? And if we disable this, does this show that weird log information that we turned this off for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps my code comment is confusing.
To explain,
- Google HTTP Client's
HttpTransport
class usesJUL.Logger.getLogger(HttpTransport.class.getName())
to log detailed network traffic. HttpTransport
class outputs detailed network traffic at INFO level.- In Gradle, increasing general verbosity to at least
--info
allows JUL to print INFO messages, as expected. - Therefore, running
gradle --info
generates a lot of network traffic output. This is unnecessary clutter, so we universally disabled the JUL logging ofHttpTransport
by callingsetLevel(Level.OFF)
when we start a task. We still want this. - Therefore, our FAQ instructions to capture detailed networks logs using JUL (via
-Djava.util.logging.config.file
) doesn't work.
Does this make it clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooooh I see, yeah sounds good.
Fixes #2356.
One of the ways to have a custom logger is through the system property
java.util.logging.config.file
. If it's defined, don't disable Google HTTP Client logging.