什么是设置为logging level == debug
Spring Security的4.x的正确方法是什么?我正在使用slf4j/log4j
。弹簧安全日志记录级别调试不一致的行为
这里是我试过,log4j.properties:
...
log4j.logger.org.springframework.security=DEBUG
还与尝试:
log4j.category.org.springframework.security=DEBUG
下返回false在AbstractAuthenticationProcessingFilter.successfulAuthentication
:
if (logger.isDebugEnabled()) {
logger.debug("Authentication success. Updating SecurityContextHolder to contain: "
+ authResult);
}
然而在SecurityContextPersistenceFilter
的测试调试返回true,我可以看到调试输出:
if (debug) {
logger.debug("SecurityContextHolder now cleared, as request processing completed");
}
控制台充满语句,如以下,表明日志记录级别确实debug
:
2016-01-20 12:10:34,849 DEBUG org.springframework.security.web.savedrequest.DefaultSavedRequest.propertyEquals(321): - pathInfo: both null (property equals)
2016-01-20 12:10:34,849 DEBUG org.springframework.security.web.savedrequest.DefaultSavedRequest.propertyEquals(321): - queryString: both null (property equals)