tags:

views:

102

answers:

1

Hi,

We're using slf4j in a java webapp, and i'd like to be able to enable via log4j.properties an option which means that every method entry (and maybe exit?) is logged, so that we can track what is happening.

Of course, I could add logger.debug(xx) statements in every method, but is it possible to do this automatically? I've seen vague references to intereptors but I dont know yet if thats what I should be looking at.

Thanks, Dan

A: 

Use need to use Aspect Oriented Programming and write up a tracing intercepter and apply that to all the interested classes.

mP
Perfect thanks, after following implementations list on Wikipedia about AOP it sent me to AspectJ which is a Java impl. Thanks.
Codek