Is there a way I can tell Java to trace certain functions by marking them with an annotation? I want to be able to do this:
class Foo {
@trace
int foo(int bar) {
return bar + 5;
}
}
Then, if tracing is enabled, I get:
** Entering foo(5)
** foo returning: 10
you can do this using spring aop, with @Around annotations
How to implement AOP logging:
add this to applicationContext.xml
create the following class in com.company.* package: