How can I enable logging for Spring Security in Grails 2.2.3?

66 Views Asked by At

How do I enable logging for Spring Security in grails 2.2.3 ?

I what to see the full log of spring security. I trying to handle it on onAuthenticationFailure method but did not worked

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

There are 1 best solutions below

0
arash yousefi On BEST ANSWER

you could set the log level to debug for root in your project so it would log everything or you could set it only for springsecurity. try this link : How do I enable logging for Spring Security?