Answers for "log errors with stack traces spring"

0

log errors with stack traces spring

@Component
public class AppExceptionResolver extends AbstractHandlerExceptionResolver
{
    private static final Logger logger = LoggerFactory.getLogger(AppExceptionResolver.class.getSimpleName());

    @Override
    protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex)
    {
        logger.error("Application error in: [" + ex.getClass().getName() + "]", ex);
        return null;
    }
}
Posted by: Guest on August-31-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language