I m moving a website to Hostmonster and asked where the server log is located so I can automatically scan it for CGI errors. I was told, "We re sorry, but we do not have cgi errors go to any files that you have access to."
For organizational reasons I m stuck with Hostmonster and this awful policy, so as a workaround I thought maybe I d modify the CGI scripts to redirect STDERR to a custom log file.
I have a lot of scripts (269) so I need an easy way in both Python and Perl to redirect STDERR to a custom log file.
Something that accounts for file locking either explicitly or implicitly would be great, since a shared CGI error log file could theoretically be written to by more than one script at once if more than one script fails at the same time.
(I want to use a shared error log so I can email its contents to myself nightly and then archive or delete it.)
I know I may have to modify each file (grrr), that s why I m looking for something elegant that will only be a few lines of code. Thanks.