I'm trying to create an annotation to log all methods in annotated class, but I have a problem with my pointcut, it's not applied (AspectJ version 1.7.4, aspectj-maven-plugin version 1.7).
(advice defined in com.test.util.log.Logger has not been applied
[Xlint:adviceDidNotMatch]).
Pointcut:
@Pointcut(value = "execution(* (@Loggable *).*(..))"))
Annotation:
@Retention(RetentionPolicy.RUNTIME)
@Target(value = { ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE })
public @interface Loggable {
public enum Level {
TRACE, DEBUG, INFO, WARN, ERROR, FATAL
};
boolean entry() default true;
boolean exit() default true;
String prefix() default "";
String suffix() default "";
Level level() default Level.DEBUG;
}
Thank you