Howdy,

>I would expect that the Appenders and Formatters only come
>into play if debug is enabled. Am I wrong ?

You're right in principle, but the definition of "debug is enabled" is
not always trivial: a class may have multiple loggers (and in log4j 1.3,
multiple loggers in multiple logging domains) with different levels set
up, so one may be debug-enabled while another isn't.

There are also other more advanced log4j usage cases which increase the
complexity of the debug call.  But this is getting off-topic: the basic
point was that the isDebugEnabled() check is a good practice, can only
improve performance (at runtime, without changing code or using
pre-processors), and can help the original poster.

Yoav Shapira

>
>> -----Original Message-----
>> From: Shapira, Yoav [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, December 04, 2003 3:34 PM
>> To: Tomcat Users List
>> Subject: RE: How to measue performance? Log4j on/off.
>>
>>
>>
>> Finally, even the example with debug("x") vs. debug(translate("x"))
>> missed something -- the possibly complex configuration of log4j.  If,
>> for example, you have an appender such as JMS, Telnet, or
>> SMTP (all come with log4j) configured to send out debug messages,
>> every call to debug can be much much more expensive than simply
>> writing a text string to a file.
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]




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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to