Title: RE: when to use each log level

Simon,

I would use INFO for, well, informational messages like 'User 234 successfully logged in' or statistical information if you shoose to log that in this manner. WARN is for non-critical errors like 'Unable to access SQL server, but will try again later' that will not greatly affect system functionality. ERROR is for problems that WILL affect system functionality (like a failure to access the database that cannot be recovered from at a later time).

In production, I would (but that's just me) turn on everything except DEBUG. At the very least you should turn on everything more severe than WARN.

Hope this helps. I would be interested in what others have to say about this.
Erik

-----Original Message-----
From: Simon Wallis [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 10, 2005 3:05 PM
To: [email protected]
Subject: when to use each log level


Hi,

I would like to set some guidelines for developers in my team on when each logging level should be used. Can someone who's been using this for a while provide some guidance?

Eg.,
FATAL - use when a critical system failure happens. This is a situation where someone would want to be paged in the middle of the night to fix.

ERROR - for recording exceptions and other definite problem situations. You might not need to be paged in the middle of the night, but this is important enough that an email should be sent to a mailbox that's monitored on a regular basis. Recurring errors need immediate attention.

WARN - ???

INFO - ???

DEBUG - self-explanitory. Basic debugging statements that someone would only care about if they were investigating a problem with your component.

The situation I want to avoid is developers logging things as errors when they're not that important, or conversely some people logging everything as debug events.

Another question: what is the minimum log level that most people turn on in production? Just errors or all levels of logging?

Thanks for your guidance,
Simon.

The information transmitted by this e-mail message is intended solely for the use of the person to whom or entity to which it is addressed. The message may contain information that is privileged and confidential.  Disclosure, dissemination, distribution, review, retransmission to, other use of or taking any action in reliance upon this information by anyone other than the intended recipient is prohibited. If you are not the intended recipient, please do not disseminate, distribute or copy this communication, by e-mail or otherwise. Instead, please notify us immediately by return e-mail (including the original message with your reply) and then delete and discard all copies of the message.

Although we have taken precautions to minimize the risk of transmitting viruses we nevertheless advise you to carry out your own virus checks on any attachment to this message. We accept no liability for any loss or damage caused by viruses.

Reply via email to