In a standalone Spring Boot web application (executable jar), how do you tell Spring Boot that we want the embedded Tomcat instance\'s HTTP access logs to be sent to stdout?
JohanB's solution works, but if you don't want to write code, someone did it better and wrapped Server access logs in a nice Spring Boot starter. It covers Tomcat, Jetty and Undertow.
Just add the dependency :
net.rakugakibox.spring.boot
logback-access-spring-boot-starter
2.7.1
And a logback-access.xml file at the classpath root :
common
and the access logs are printed to stdout :
127.0.0.1 - - [08/févr./2019:11:23:30 +0100] "GET /password HTTP/1.1" 200 32
At this point you will need to create the TeeFilter Bean on your own if you want to print the full HTTP request & response for debugging.