如何在grails 2.2.3中为Spring Security启用日志记录?
我想看看 Spring 安全的完整日志。我尝试在onAuthenticationFailure方法上处理它,但没有成功
public void onAuthenticationFailure(final HttpServletRequest request, final HttpServletResponse response,
final AuthenticationException exception) throws IOException, ServletException {
ObjectMapper objectMapper = new ObjectMapper();
if (SpringSecurityUtils.isAjax(request)) {
saveException(request, exception);
getRedirectStrategy().sendRedirect(request, response, _ajaxAuthenticationFailureUrl);
}
else {
super.onAuthenticationFailure(request, response, exception);
}
}
1条答案
按热度按时间ej83mcc01#
你可以在你的项目中为root设置日志级别为debug,这样它就可以记录所有的事情,或者你可以只为springsecurity设置它。试试这个链接:How do I enable logging for Spring Security?