什麼是設置爲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)