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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Lucas-Smith

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



    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

    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
  • chernyshevsky@hotmail.com

    #2
    Re: Date in Apache2's error log when error caused by PHP

    >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.

    Comment

    • Martin Lucas-Smith

      #3
      Re: Date in Apache2's error log when error caused by PHP



      On Mon, 4 Apr 2005, chernyshevsky wrote:[color=blue][color=green]
      > >From the Apache 2 SAPI source code:[/color]
      >
      > /* 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.[/color]

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




      Martin

      Comment

      • Martin Lucas-Smith

        #4
        Re: Date in Apache2's error log when error caused by PHP



        On Tue, 5 Apr 2005, Martin Lucas-Smith wrote:[color=blue]
        > On Mon, 4 Apr 2005, chernyshevsky wrote:[color=green][color=darkred]
        > > >From the Apache 2 SAPI source code:[/color]
        > >
        > > /* 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.[/color]
        >
        > 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[/color]

        Which they've now fixed. Nice..


        Martin

        Comment

        Working...