By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

Date in Apache2's error log when error caused by PHP

P: n/a


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.err...#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.
Martin
Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
>From the Apache 2 SAPI source code:

/* 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
*/

I think you and rbb need to chat.

Jul 17 '05 #2

P: n/a


On Mon, 4 Apr 2005, chernyshevsky wrote:
From the Apache 2 SAPI source code:


/* 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
*/

I think you and rbb need to chat.


Thanks - well spotted. I have submitted this as a bug report in the hope
that the PHP developers might debate this further.

http://bugs.php.net/bug.php?id=32587
Martin
Jul 17 '05 #3

P: n/a


On Tue, 5 Apr 2005, Martin Lucas-Smith wrote:
On Mon, 4 Apr 2005, chernyshevsky wrote:
From the Apache 2 SAPI source code:


/* 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
*/

I think you and rbb need to chat.


Thanks - well spotted. I have submitted this as a bug report in the hope
that the PHP developers might debate this further.

http://bugs.php.net/bug.php?id=32587


Which they've now fixed. Nice..
Martin
Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.