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

Too much logging when building an OCI image with Maven #22674

Closed
dsyer opened this issue Jul 30, 2020 · 3 comments
Closed

Too much logging when building an OCI image with Maven #22674

dsyer opened this issue Jul 30, 2020 · 3 comments
Labels
type: bug A general bug
Milestone

Comments

@dsyer
Copy link
Member

dsyer commented Jul 30, 2020

mvn spring-boot:build-image -X logs every byte to and from the Docker daemon ...it's kind of too much. You get a lot of lines like this for example:

[DEBUG] http-outgoing-0 >> "[0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][0x0][\r][\n]"
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 30, 2020
@wilkinsona
Copy link
Member

When launched with -X Maven enables debug level logging for everything. In this case, that includes the Apache HttpClient which is what's producing all the unwanted output. Maven used to have this problem itself. They fixed it by customising the log levels for their shaded version of Apache HttpClient with the following in MAVEN_HOME/conf/logging/simplelogger.properties:

# MNG-6181: mvn -X also prints all debug logging from HttpClient
# Be aware that the shaded packages are used
# org.apache.http -> org.apache.maven.wagon.providers.http.httpclient
org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient=off
org.slf4j.simpleLogger.log.org.apache.maven.wagon.providers.http.httpclient.wire=off

Changing that file isn't something Boot can do (although users could modify it themselves) so I'm not sure there's much we can do about this.

@dsyer
Copy link
Member Author

dsyer commented Jul 31, 2020

Couldn’t we use the same shaded HTTP client? Or shade it again? I guess if not the best fix is to persuade the client to log all that craft at TRACE instead of DEBUG?

@wilkinsona
Copy link
Member

Couldn’t we use the same shaded HTTP client?

It won't always be available as the code that uses the HTTP client isn't Maven-specific. It is used by the Gradle plugin as well.

Or shade it again?

I don't think that would help, unless we shaded it with Maven's org.apache.maven.wagon.providers.http.httpclient package name which would look rather odd and may cause a clash.

I guess if not the best fix is to persuade the client to log all that craft at TRACE instead of DEBUG?

Either that, or to at least make it configurable.

Looking at the HTTP Client code again, we might be able to provide our own equivalent of org.apache.http.impl.conn.ManagedHttpClientConnectionFactory that creates DefaultManagedHttpClientConnection instances rather than LoggingManagedHttpClientConnection.

@wilkinsona wilkinsona added the for: team-attention An issue we'd like other members of the team to review label Aug 12, 2020
@philwebb philwebb added type: bug A general bug and removed for: team-attention An issue we'd like other members of the team to review status: waiting-for-triage An issue we've not yet triaged labels Aug 12, 2020
@philwebb philwebb added this to the 2.3.x milestone Aug 12, 2020
@philwebb philwebb modified the milestones: 2.3.x, 2.3.4 Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants