in reply to How can I Disable script.error_log ?

For my CGI scripts, I like to redirect STDERR to a file. I use File::Basename to extract the script filename, open up the error log, and call it a day. You may want to either truncate the error log on each run, or truncate it when it reaches a certain size.

Sure, there are race conditions. Sure, it'd be much better to run an error logging server. But if your script is stable enough for production and you just don't have the time to track down some verbose, non-critical errors, this method will keep your logs in check.

But, that's a quick fix. Malach is right. A well-written script shouldn't give you that many errors. Your best bet for long term is to fix your script so it doesn't generate the warnings under -w.
  • Comment on Re: How can I Disable script.error_log ?

Replies are listed 'Best First'.
An aside WAS Re: How can I Disable script.error_log ?
by belg4mit (Prior) on Feb 19, 2002 at 06:22 UTC
    My preferred solution, while not used for this though it could be, is to have Apache use a perl-script as a logging process. In the script I can do any kind of segregation, ignoring, etc. I want to for any entries.

    If you really want to look at some moldy code here it is, flog. I don't need a code review though, 'm-k? Just glancing at it makes me cringe. But believe it or not I've been using it continuously since I wrote it oh so long ago. I've been meaning to get around to touching it up a bit, maybe someday...

    --
    perl -pe "s/\b;([st])/'\1/mg"