Spring Aop没法代理new的对象只能代理ioc容器内的bean,导致有些日志没法记录。
改成aspectJ做代理
1、aspectJ做代理,因为AspectJ是在编译时织入,Aop是在运行时织入。
2、AspectJ能够在所有域对象中利用,Aop只能利用于由 Spring 容器治理的 bean。
3、AspectJ是动态代理,Aop由动静代理JDK代理、CGLib代理。
4、AspectJ能够代理call和execution等,Aop只能代理点execution。(call捕捉的joinpoint是签名办法的调用点,而execution捕捉的则是执行点)
发表回复