#32587 [Opn->Asn]: PHP errors sent to Apache2 error_log do not include time unlike Apache1

From: Date: Fri, 08 Apr 2005 20:11:21 +0000
Subject: #32587 [Opn->Asn]: PHP errors sent to Apache2 error_log do not include time unlike Apache1
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-76542@lists.php.net to get a copy of this message
ID: 32587 Updated by: sniper@php.net Reported By: mvl22 at mailinator dot com -Status: Open +Status: Assigned Bug Type: Apache2 related -Operating System: Linux +Operating System: * -PHP Version: 5.0.3 +PHP Version: 4CVS, 5CVS (2005-04-08) -Assigned To: +Assigned To: sniper Previous Comments: ------------------------------------------------------------------------ [2005-04-05 14:09:27] mvl22 at mailinator dot com Description: ------------ I posted to the comp.lang.php newsgroup about this. See: http://tinyurl.com/4gxde (which goes to a URL on Google Groups. ---- I've noticed since moving from Apache1/mod_php4/linux to Apache2/mod_php5/linux that when an error is produced by PHP and put in the error_log, the date is no longer logged as well: Apache1/php4/linux example in Apache error_log: [Thu Jan 8 15:06:52 2004] [error] PHP Warning: opendir(/foo/bar/): failed to open dir: No such file or directory in /blah/something/listing.html on line 84 Apache2/php5/linux example in Apache error_log: [client 1.2.3.4] PHP Notice: Undefined variable: browserline in /foo/bar/zing.html on line 18 Is there any way to restore this, either at PHP or Apache level? NB There is an inconclusive note at http://www.php.net/manual/en/ref.errorfunc.php#ini.error-log which states: "As pointed out previously, PHP by default logs to the Apache ErrorLog. Beware: the messages it logs do not conform to Apache's error log format (missing date and severity fields), so if you use an automated parser on your error logs, you'll want to redirect PHP's errors somewhere else with the error_log directive." But no mention that the behaviour has changed. -- The reply I received points to a section of source code in the Apache 2 SAPI driver - http://cvs.php.net/php-src/sapi/apache2handler/sapi_apache2.c - , which contains the note: /* We use APLOG_STARTUP because it keeps us from printing the * data and time information at the beginning of the error log * line. Not sure if this is correct, but it mirrors what happens * with Apache 1.3 -- rbb */ Personally having the date of the error is extremely useful, and I see no reason not to want this in the error log. It is often useful for debugging to know when an error occured. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32587&edit=1

« previous php.bugs (#76542) next »