[slf4j-dev] Repost

Thorbjørn Ravn Andersen thunderaxiom at gmail.com
Mon Aug 25 08:51:09 CEST 2008


Ceki asked me to repost this mail on this list:

(I am adapting the "use java 5 agent to add logging statements to 
classes at classload time" approach to work with slf4j and to reach 
production strength)

On Thu, Aug 21, 2008 at 6:33 PM, Ceki Gulcu <ceki at qos.ch> wrote:

 > Hello Thorbjørn,

 > Do you have any comments on my last message?

Yes.

I've signed the CLA but not actually mailed it yet, and started looking 
at doing the necessary changes to make a production strength package 
(and looking into performance later).  I suggest the using the 
org.slf4j.instrumentation package for this. 

I still keep the "if (log.isDebugEnabled()) log.debug("a=" + a + ", b=" 
+ b))" approach as it avoids having to do the equivalent of autoboxing 
when creating the objects to pass.  Also it works for me :)

Please note that each Java agent must be present in an executable jar, 
which in turn means that you can maximally have one agent in a given 
jar.    There is also the issue of the supportive javassist library, so 
if the license permits I suggest that this agent jar is a single 
download containing only the agent code with the javassist library 
enclosed, and that it is kept seperate and named accordingly.

It is not necessary to embed the slf4j API in it as this should be 
available in the main application at the time when this code runs.

A thing that might be interesting to have on the slf4j web site is a new 
section to the user guide named "Best practices" or similar.  This might 
get suitable attention and give some suitable help.  I have dug up the 
XML-snippet that makes Eclipse insert a logger defintiion when creating 
a new class. That would be perfect.

Comments?




-- 
Thorbjørn Ravn Andersen - "...plus...Tubular Bells!"

-- 
  Thorbjørn Ravn Andersen          "... plus... Tubular Bells!"




More information about the slf4j-dev mailing list