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

Ceki Gulcu listid at qos.ch
Thu Oct 2 22:20:55 CEST 2008



Thorbjørn Ravn Andersen wrote:
> 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 don't believe using xlogger instead of logger would be any more complex, 
probably the contrary is true.

>> 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.

User comfortable with java bytecode changing can probably deal with setting the 
level of the root logger.

> /Thorbjørn

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch



More information about the slf4j-dev mailing list