Reputation: 13529
I have an interceptor which I'm trying to use to log:
package com.noxgroup.nitro.security;
...
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
@Component
public class SecurityInterceptor implements HandlerInterceptor {
private static final Logger log = LoggerFactory.getLogger(SecurityInterceptor.class);
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handlingObject) throws Exception {
log.debug("Interceptor firing...");
}
}
So I configured application.properties as such:
debug=true
logging.level.org.springframework.web=DEBUG
logging.level.com.noxgroup.nitro=DEBUG
logging.level.com.noxgroup.nitro.security=DEBUG
But no suck luck. Nothing appearing in the console. System.out.println
does work though.
Note: I'm using spring-boot-starter-web
which I'm under the impression has an implementation of Apache Commons Logging within it...
Edit: I can log info
, but debug
isn't logging.
Upvotes: 0
Views: 3671
Reputation: 13529
The problem turned out three-fold:
info
but not level debug
@Configuration
class that was loading a properties file, on-the-fly. It actually needs to be in the spring detected application.propertiesUpvotes: 1
Reputation: 8965
Did you try to set the level to DEBUG for your own package, i.e.
logging.level.com.noxgroup.nitro.security=DEBUG
To run every log in DEBUG mode, you can also try
logging.level.=DEBUG
Upvotes: 4