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]"

Comment From: wilkinsona

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.

Comment From: dsyer

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?

Comment From: wilkinsona

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.