Redirecting STDERR
Posted: Tue Jun 14, 2005 7:02 am
Something I use occasionally in Perl is a bit of code that redirects the STDERR stream to a file instead of its usual destination:
Is there a way to do something similar in PHP? I've looked at writing a custom error handler with set_error_handler(), but I can't get it to work with anything other than simple warnings. I really need to capture *every* error to somewhere other than the usual log.
Code: Select all
open STDERR, "e;>>errors.txt"e; or die "e;Can't redirect STDERR: $!"e;;