Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: What module do you like for debugging CGI scripts - Log::Dispatch

by imp (Priest)
on Jan 27, 2007 at 15:28 UTC ( #596878=note: print w/ replies, xml ) Need Help??


in reply to What module do you like for debugging CGI scripts

My preferred approach is to only log fairly important events by default, but to record the entire debug trail in a database when an error occurs. In production environments this approach avoids the usual problem of having either too much log output (filling the log file and wasting disk IO), or too little (unable to diagnose errors). It is also helpful to log the contents of %ENV and sometimes a dump of the current CGI params, but be careful not to record credit card numbers in a log file.

The best module for this that I have found is Log::Dispatch with Log::Dispatch::Buffer, but I'm sure you could do something similar with Log::Log4perl. You should always log things of notice level or higher to syslog in my opinion.

I designed this sytem for something that used CGI::Application and added a teardown task that handled the check for highest severity.

If your reason for asking for a logging system recommendation is that you are currently trying to track down a bug, then I very strongly recommend you break some of your supporting code into supporting modules and write a reasonable test suite for it. Once you start writing tests you'll never go back :)


Comment on Re: What module do you like for debugging CGI scripts - Log::Dispatch

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://596878]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2014-07-28 16:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (204 votes), past polls