I've created a custom error handler for this. See http://
php.net/set_error_handler and http://php.net/set_exception_handler

Also note the stuff about @ error suppression, which is used in Zend_Loader

if (error_reporting() == 0) return; at the start of the error handler should
do the trick.

Vincent de Lau
 [EMAIL PROTECTED] 

> -----Original Message-----
> From: sgrobins [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 30, 2008 8:38 PM
> To: [email protected]
> Subject: [fw-general] capture STDERR with Zend_Log
> 
> 
> Hello,
> 
> I am using Zend_Log for all my output in a script that is run from
> cron.
> Everything works great.  I have it writing to a log file each night.
> 
> The problem is if the script encounters a Fatal Error or a PHP Warning,
> those are not put into the log file, since that output didn't go
> through
> Zend_Log.  Is there a way to redirect the STDERR to my Zend_Log object,
> so
> it becomes something like this:
> 
> $logger->err( "whatever php error produced" );
> 
> Then each day I can look at my log file and see exactly where these php
> warnings or errors are happening in my script.
> 
> Thanks,
> Shawn
> --
> View this message in context: http://www.nabble.com/capture-STDERR-
> with-Zend_Log-tp18739880p18739880.html
> Sent from the Zend Framework mailing list archive at Nabble.com.


Reply via email to