All the Perl that's Practical to Extract and Report

Navigation

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
Without JavaScript enabled, you might want to
use the classic discussion system instead. If you login, you can remember this preference.

Please Log In to Continue

I think the main problem with logging is that initially you don't really know what information will be useful so it's best to log much more than you think you will need. For me this also applies to the format of the logs -- I just don't know what will be the best format to delog when a problem does occur. For some apps it seems that certain types of logs (e.g. text) are just hard sift through, when for others those same types work great.

If you use something like log4perl or Log::Dispatch, as suggested earlier, you can set up multiple levels of logs that you can adjust without altering code, and then just spew as desired. For example: initially log details to a database and a series of space-managed (e.g. rotated) log files until you decide which way is really the easiest for you to delog; log a subset of messages to another file to give you a higher level view of what is going at a glance and perhaps mail the tail of this file if an important event occurs. Over time you can adjust how these are configured, but at least you don't have to fiddle with code as much.