Skip to content
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

Merged
merged 4 commits into from
Mar 26, 2020

Conversation

chanseokoh
Copy link
Member

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.

@chanseokoh
Copy link
Member Author

Travis seems to have completely stalled. Will try closing and reopening.

@chanseokoh chanseokoh closed this Mar 24, 2020
@chanseokoh chanseokoh reopened this Mar 24, 2020
// 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);
Copy link
Member

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?

Copy link
Member Author

@chanseokoh chanseokoh Mar 26, 2020

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 uses JUL.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 of HttpTransport by calling setLevel(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?

Copy link
Member

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.

@chanseokoh chanseokoh merged commit 547ef15 into master Mar 26, 2020
@chanseokoh chanseokoh deleted the gradle-http-logs branch March 26, 2020 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Jib Gradle plugin disables Google HTTP Client logging
3 participants