What is worth logging?

  • Thread starter Thread starter Jimmy
  • Start date Start date
J

Jimmy

I'm working on conventions for a large e-commerce application. Sure, I
can tell the R&D to "log everything" but it's unlikely to be done.
Waiting to hear from your experience - what info proves worth of
logging on a regular basis?

Thanks,
J.
 
Hi Jimmy,

Errors, for one thing. Other information depends on the requirements of the app. If the app is stateful, I'd log information that
sums up the state of the app at various times, like the end of each day, so that you won't be too far off from any problems, if they
should occur, related to corrupted or invalid state. In this case auditing can be extremely helpful as well if you provide
restricted services to end users and administrative users that require authentication and authorization. You might want to log hits
and other statistical information. Output from performance counters could be logged as well.

When deciding what needs to be logged, analyze each possibility and determine whether the requirements of the app indicate a need
for logging. The same requirements that determine the need for logging usually determine the need for notifications as well, such
as an e-mail that is automatically sent to an address that is monitored by the web master in the case of a critical error.

Microsoft provides two Application Blocks; Exception Handling Block and a Logging & Instrumentation Block that are both configurable
at runtime and provide applications whether best-practice implementations for error handling and logging, respectively:

http://msdn.microsoft.com/practices/guidetype/appblocks/

HTH
 
Just to add to Vadym's post (which I totaly agree with). Make sure that the
logging levels can be set in the field by the customer (Don't make it hard
for them to change this setting). And if the product is a server, you'll
want to allow on-the-fly configuration (don't make them shut it down and
restart).

Kim Greenlee
 
Back
Top