Aspect 用于方法出入口日志记录 博客分类: Aspect aspectSpring
程序员文章站
2024-03-24 09:24:04
...
@Aspect public class Aspect { @Before("execution(* com.test.*.*(..))") public void logBefore(JoinPoint joinPoint) { logEnter..... } @After("execution(* com.test.*.*(..))") public void logAfter(JoinPoint joinPoint) { logExit..... } }
Spring config:
<aop:aspectj-autoproxy/> <bean id="aspect" class="com.test.Aspect"></bean>
备注:
Spring 3.1.0