log errors with stack traces spring

Solutions on MaxInterview for log errors with stack traces spring by the best coders in the world

showing results for - "log errors with stack traces spring"
Giulio
07 Feb 2016
1@Component
2public class AppExceptionResolver extends AbstractHandlerExceptionResolver
3{
4    private static final Logger logger = LoggerFactory.getLogger(AppExceptionResolver.class.getSimpleName());
5
6    @Override
7    protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
8    {
9        logger.error("Application error in: [" + ex.getClass().getName() + "]", ex);
10        return null;
11    }
12}
13