How to enable http server logs in an embedded tomcat server provided by spring boot? I've tried this in application.properties
but it doesn't create file, neither logs to console
#application.properties
server.tomcat.access-log-enabled=true
server.tomcat.access-log-pattern=%a asdasd
logging.file=/home/mati/mylog.log
spring boot 1.0.1.RELEASE
Here it goes a way to have them displayed in console or whatever file you choose. Declare Tomcat's
RequestDumperFilter
in any@Configuration
class:And that's the output:
Then manage it as any standard Spring Boot log.
In Spring Boot 1.5.1 the properties mentioned by Dave Syer no longer works, instead they're renamed into:
Using the configuration above, if running the project via its root directory the log will be available at target/tomcat-logs/log/access_log.*
Try
and look in
/tmp/tomcat.<random>.<port>/logs
for the output files. Setserver.tomcat.basedir
property to change the directory.