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>
原文地址:https://www.cnblogs.com/xue88ming/p/7194369.html