I'm trying to log all 400 and 500 error petition that throw the application.
I don't know if there is some way of doing.
The more equal that I found is /error
petition who is class to define the format of all the exceptions raised in the backend but I don't know how to face it.
any suggestions?
I use spring-boot like framework. My error class look something like this :
@Controller
public class ErrorController extends AbstractErrorController
{
public ErrorController(ErrorAttributes errorAttributes)
{
super(errorAttributes);
}
@RequestMapping(value = "/error", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public Map<String, Object> handleError(HttpServletRequest request)
{
Map<String, Object> errorAttributes = super.getErrorAttributes(request, false);
return errorAttributes;
}
@Override
public String getErrorPath()
{
return "/error";
}
}