Rather than manually writing code such as
public void someMethod(Object someArg, Object otherArg) {
logger.trace("someMethod invoked with arguments {}, {}", someArg, otherArg);
// method body
}
I would like to generate such statements automatically using AOP. The app in question is a Spring Boot 2.3.3 app.
I don't think it's possible to generate logging statements for all method calls using AOP, only for methods calls on Spring beans. This would be good enough for my current purposes.
Could someone explain the specific steps for how I add an aspect to a Spring Boot app that will generate a log statement such as the above for all method calls on Spring beans? If only public method calls can be intercepted by the aspect, that would be good enough.