logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <Yoav.Shap...@mpi.com>
Subject RE: Naming loggers / resolving calling classes
Date Wed, 09 Apr 2003 14:58:15 GMT

Howdy,
How about adding getClass().getName() to every logging call inside your
classes?

Yoav Shapira
Millennium ChemInformatics


>-----Original Message-----
>From: Jonathan Whitall [mailto:fiddlerpianist@yahoo.com]
>Sent: Wednesday, April 09, 2003 10:54 AM
>To: log4j-user@jakarta.apache.org
>Subject: Naming loggers / resolving calling classes
>
>Hello,
>
>I have a problem.  In my logging message, I want to be
>able to output the name of the class that initiates
>the logging, i.e. the caller, with something similar
>to this:
>
>[2003-04-08 19:57:40,019 INFO] com.mycompany.MyClass:
>message
>
>I cannot afford to use the %C option for
>PatternLayout, because it really is a performance hog
>(it was taking 300ms for one logging statement!)  The
>only other option that I can think of is to
>instantiate separate loggers for each class by using
>the class name as the logger name, and then using %c
>in the conversion pattern instead of %C.  I have seen
>this done in a few examples.  Is this considered best
>practice, or are there serious performance
>considerations with getting separate loggers like
>this?
>
>Thanks,
>
>Jonathan Whitall
>
>__________________________________________________
>Do you Yahoo!?
>Yahoo! Tax Center - File online, calculators, forms, and more
>http://tax.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org




This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Mime
View raw message