Thanks for the replies. I didn't appreciate quite how dynamic log4j is. I wonder why the log4j examples/FAQ etc don't suggest final.
What's the school of thought between the naming conventions for the logger variable? private static final Logger LOG = Logger.getLogger(MyClass.class); or private static final Logger log = Logger.getLogger(MyClass.class); I've only ever seen the latter in use but the java code conventions suggest capitals for constants and I'm a firm believer in sticking to the conventions. However the term "constant" is not well defined in the code conventions. Is a constant any final variable (a constant reference) or is a constant only a final variable that is immutable (constant value)? I ask on this list because _if_ the log4j documentation changes to include a final example then it should be keeping to conventions also. ----- Original Message ----- From: "Shapira, Yoav" <[EMAIL PROTECTED]> To: "Log4J Users List" <[EMAIL PROTECTED]> Sent: Friday, January 16, 2004 5:37 PM Subject: RE: Absolute performance Howdy, >private static final Logger LOG = Logger.getLogger(MyClass.class); This is good and I do it as well as recommend it to others. >private static final boolean DEBUG_ENABLED = LOG.isDebugEnabled(); This is not good because isDebugEnabled potentially changes with time during a program's execution, and that's one of log4j's main features. Yoav Shapira 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
