[slf4j-dev] svn commit: r1155 - in slf4j/trunk/slf4j-ext/src/main/java/org/slf4j: agent instrumentation

Thorbjørn Ravn Andersen ravn at runjva.com
Thu Oct 2 21:30:12 CEST 2008


Ceki Gulcu skrev:
>
> Does _log field refers to a logger named after the containing class? If so, you 
> could enable/disable logging for each java class separately using the 
> configuration mechanism provided in log4j/jul/logback. In other words, 
> additional configuration in the agent is *unnecessary*. Is that nice or what?
>
>   
Yes.  It is initialized based on the name of the class being instrumented.

The name "_log" is currently hardcoded, but it should be anonymous/an 
unused name. 

> The only problem with this approach is that you would be enabling/disabling 
> logging for the entire class. Had you used markers, one could enable/disable 
> entry/exit logging without necessarily affecting logging in the rest of the 
> containing class. By the way, XLogger.enter() and exit() methods use the 
> appropriate markers.
>   
As I mentioned in another mail, this is intentionally kept very simple.


> I'd also like to point that XLogger.enter and exit() method use the TRACE level 
> whereas LogTransformer uses DEBUG. A little consistency is in oder... Either 
> both use TRACE or both should use DEBUG.
>   

Actually in the article I used the INFO level as it is the lowest level 
printed out by j.u.l without a configuration file.  I think it would be 
a valid default level to keep the entry barrier as low as possible, and 
then have a "level" keyword to the agent to override this.

/Thorbjørn



More information about the slf4j-dev mailing list