Firstly I tell that I am newbie at spring (on the whole, also AOP). At this moment I have working rest api.
I am trying to use this thread:
Spring Boot - How to log all requests and responses with exceptions in single place?
I am using spring boot and only annotations configuration. I tried to follow this tutorial, however I have simple problems, I ask you for your help ( I tried to read more about AOP, but I would rather implement concrete example and then try to dig deeper ).
1. <aop:aspectj-autoproxy/>
Is it possible to express it using only annotations ?
2.
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD,ElementType.TYPE})
public @interface EnableLogging {
ActionType actionType();
}
Where this fragment should resiude ? I tried to conclude and some place, but no effect.
3. What about turning on Aspect ? What does it mean ? For example, what does it mean this line:
@AfterReturning(pointcut = "execution(@co.xyz.aspect.EnableLogging * *(..)) && @annotation(enableLogging) && args(reqArg, reqArg1,..)", returning = "result")
Thanks in advance, answers to this question should help me get better aop.