How to exclude methods from aspectj

Viewed 13972

I'm trying to exclude several methods from log files using aspectj (Im usong spring and Load-time weaving). Is there a way to list the excluded methods in the aop.xml? I know i can do this for full classes but I'm looking for specific methods. or can i make a list in the aspect class? Thanks

3 Answers

In XML just prepend with a '!' what you want to exclude. And instead of || one has to use AND to append it.

execution(* de..*Service.update*(..)) &&
!execution(* com..MyService.methodToExclude*(..))
Related