Mati Mati - 3 months ago 270
HTTP Question

Spring Boot enable http requests logging

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

Answer

Try

server.tomcat.accessLogEnabled=true
server.tomcat.accessLogPattern=%a asdasd

and look in /tmp/tomcat.<random>.<port>/logs for the output files. Set server.tomcat.basedir property to change the directory.