-
Notifications
You must be signed in to change notification settings - Fork 537
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问不要使用ControllerAdvice代替AOP的原因是什么? #7
Comments
ControllerAdvice是有异常的时候才触发,我们的aop除了处理异常还有打印日志等功能。 |
您好!有2点不是很明白。 |
亲测:ControllerAdvice一样可以处理异常和打印日志。 |
@ljhtoljh 可以通过 ServletRequest#getInputStream 来读body, 不过应该有更好的办法吧 |
个人理解 xwjie 的AOP可以记录正常日志和异常日志 |
在使用中,这种ControllerAdvice看上去比较简单方便。
但是在src/main/java/plm/ControllerExceptionAdvice.java的注释里特别说明了这点,看了专栏里好像没有特别说明这种方法的不足,请问有没有相关的解释说明呢?
The text was updated successfully, but these errors were encountered: