@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]);
}
}
我尝试使用@aspect输出请求体,但是如果使用@valid时参数错误,spring boot会抛出MethodArgumentNotValidException,并且不会输出@aspect日志。
即使发生异常,如何在服务器收到http请求时输出json请求正文?