java - Dynamic pointcut in spring-aop logging? -
is there way can logging using dynamic pointcut in spring aop scanning beans in package , intercepting methods?
here example of aspect intercept public methods of classes in particular package. can use starting point.
@aspect public class loggingaspect{ @around("execution(public com.test.model..*.*(..))") public void loginvocation(proceedingjoinpoint joinpoint) throws throwable { system.out.println("doing logging before"); joinpoint.proceed(); // execute target method system.out.println("doing logging after"); } }
Comments
Post a Comment