I'm using Spring AspectJ for logging method execution statistics, however, I want to exclude some classes and methods from this without changing the pointcut expression.
To exclude certain methods I created a custom annotation which I use to filter out. However I'm unable to do the same with classes.
Here is my aspect definition -
@Around("execution(* com.foo.bar.web.controller.*.*(..)) "
+ "&& !@annotation(com.foo.bar.util.NoLogging)")
public Object log(ProceedingJoinPoint proceedingJoinPoint) throws Throwable {
// logging logic here
}
NoLogging
is my custom annotation for excluding methods.
So how can I filter out certain classes without changing pointcut expression and without adding new advisors?