I have @ControllerAdvice with numerous @ExceptionHandler methods with their own logic. However, I do need a log an original Exception.
Is there a way to do it without adding explicit logging message to each @ExceptionHandler method?
I have @ControllerAdvice with numerous @ExceptionHandler methods with their own logic. However, I do need a log an original Exception.
Is there a way to do it without adding explicit logging message to each @ExceptionHandler method?
No. You should define other Exception class and do not define it in @ControllerAdvice .
then you can use this Exception and put in log
catch (DefinedException ex) {
log.info("your log here");
throw ex;
}