@Before("within(control..*)")
public void before(JoinPoint joinPoint) {
// Set Process Start Time
startTime = System.currentTimeMillis();
Object[] arguments = joinPoint.getArgs();
if (arguments != null && arguments.length > 0) {
System.out.println("data:" + arguments[0]);
}
}
I tried to use @aspect to output tht request body, but if the parameter is wrong when using @valid, spring boot will throw MethodArgumentNotValidException, and @aspect logs will not be output.
How can I output the json request body at the time when server receives a http request even there is an exceptinon happened?