PDA

View Full Version : Perl CGI Error Logging


JoeWilson
03-26-2001, 01:43 AM
Maybe I'm the last guy on the planet to figure this out, but
I've started outfitting my Perl CGIs with something like
this:

[nbsp][nbsp]open (ERR_FILE, ">>$ERROR_FILE");
[nbsp][nbsp]open (STDERR, ">&ERR_FILE");
[nbsp][nbsp]select (STDERR); $| = 1;
[nbsp][nbsp]select (STDOUT);

This accomplishes two goals:

[nbsp][nbsp]1. Avoids filling up the server web logs with all those
[nbsp][nbsp][nbsp][nbsp] error messages I didn't know I was printing.
[nbsp][nbsp]2. Lets me see all those error messages I can't see
[nbsp][nbsp][nbsp][nbsp] unless I put them somewhere.

Sorry to have been a bad web log filler in the past.<!-- NO_AUTO_LINK -->