Aspect 用于方法出入口日志记录

@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>

 

posted @ 2017-07-17 15:07  雪来了  阅读(304)  评论(0编辑  收藏  举报