Search code examples
spring-securitygrails-2.0

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


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);
        }

    }

Solution

  • 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?