Reputation: 11881
I have a Spring Boot 2.0.5 command-line application with mostly default configurations.
How can I enable HTTPClient wire-logging?
I tried throwing this into a log4j.properties
file:
log4j.rootLogger=INFO, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%c] %m%n
log4j.logger.org.apache.http=DEBUG
I tried adding spring-boot-starter-logging
to the pom.xml
.
I also tried adding JVM parameters to the app launch:
-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
-Dorg.apache.commons.logging.simplelog.showdatetime=true
-Dorg.apache.commons.logging.simplelog.log.org.apache.http=DEBUG
But nothing works. No httpclient logs at all.
How can I get some httpclient logs?
Upvotes: 6
Views: 13596
Reputation: 11881
Solution was counter-intuitive. Add this line to application.properties
:
logging.level.org.apache.http=DEBUG
Upvotes: 14