in reply to Re^2: CGI::Carp fatalsToFile
in thread CGI::Carp fatalsToFile
Just omitting CGI::Carp and just using plain old Carp should do the trick. Carp behaves nicely and writes all errors to STDERR, where they belong. The web server collects STDERR output and writes that to its error log. Problem solved, even when multiple CGIs are running concurrently (which might create nasty races when trying to write to a common log file at the CGI level). That also works when your CGI has a really bad day and just crashes before Carp or CGI::Carp can do their work.
The only remaining problem might be the hoster: Some really cheap hosters prevent you from reading your server's error log. That really sucks, and cannot be solved completely at the application (CGI) layer. If that is the case, consider changing the hoster or upgrading to a contract with access to the error log.
Alexander
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: CGI::Carp fatalsToFile
by Bod (Parson) on Oct 05, 2021 at 23:17 UTC |