#32587 [NEW]: PHP errors sent to Apache2 error_log do not include time unlike Apache1
| From: | mvl22 at mailinator dot com | Date: | Tue, 05 Apr 2005 12:09:29 +0000 |
| Subject: | #32587 [NEW]: PHP errors sent to Apache2 error_log do not include time unlike Apache1 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-76378@lists.php.net to get a copy of this message | ||
From: mvl22 at mailinator dot com
Operating system: Linux
PHP version: 5.0.3
PHP Bug Type: Apache2 related
Bug description: PHP errors sent to Apache2 error_log do not include time unlike Apache1
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 bug report at http://bugs.php.net/?id=32587&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32587&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32587&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32587&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32587&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32587&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32587&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32587&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32587&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32587&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32587&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32587&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32587&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32587&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32587&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32587&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32587&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32587&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32587&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32587&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32587&r=mysqlcfg