When I’m developing on a Spring Boot app, I want to see when a request comes in, how it was authenticated, and where it was handled.
By default, log levels are set to INFO. Nothing prints per-request.
I don’t know a good way to get the information I need, so I turn them way up:
logging.level.org.springframework=TRACE
… and then find some useful log statements, get specific in the log level for those classes, and turn the general level back to INFO.
Gradually, I’m building up a collection of useful logs. Here is that section of application.properties
so far:
logging.level.org.springframework=INFO
# turn up when necessary
# these are worth seeing
logging.level.org.springframework.web.servlet.DispatcherServlet=TRACE
logging.level.org.springframework.security.web.csrf.CsrfFilter=DEBUG
logging.level.org.springframework.security.web.access.intercept.FilterSecurityInterceptor=TRACE
logging.level.org.springframework.web.servlet.mvc.method.annotation.HttpEntityMethodProcessor=TRACE
# these are extra chatty and not useful, so keep them quiet even when I turn general logging up
logging.level.org.springframework.security.access.prepost.PrePostAnnotationSecurityMetadataSource=INFO
logging.level.org.springframework.beans.factory.support.DefaultListableBeanFactory=INFO