stderr from "system" should be logged?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry Sievers

    stderr from "system" should be logged?

    Hello. Maybe I'm just out of practice, maybe not.

    Suppose we run a command using system() and this command writes to the
    stderr stream. If I remember correctly, this is normally written to
    the Apache error log file. log_errors is ON and error_reporting is
    2047 E_ALL.

    Redirecting the stderr from the system command has it showing up on
    the browser output.

    This is on BSD Unix, Apache 1.3.x , PHP 4.3.3

    Any advice what's wrong here is appreciated.

    Thanks.

    --
    -------------------------------------------------------------------------------
    Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
    305 321-1144 (mobile http://www.JerrySievers.com/
  • Andy Hassall

    #2
    Re: stderr from "system&qu ot; should be logged?

    On 13 Jan 2005 10:15:15 -0500, Jerry Sievers <jerry@jerrysie vers.com> wrote:
    [color=blue]
    >Suppose we run a command using system() and this command writes to the
    >stderr stream. If I remember correctly, this is normally written to
    >the Apache error log file. log_errors is ON and error_reporting is
    >2047 E_ALL.
    >
    >Redirecting the stderr from the system command has it showing up on
    >the browser output.[/color]

    Redirecting it to what, stdout? Wouldn't that be expected behaviour?
    [color=blue]
    >This is on BSD Unix, Apache 1.3.x , PHP 4.3.3
    >
    >Any advice what's wrong here is appreciated.[/color]

    Could you give an example line of code to show what you're redirecting to
    where?

    --
    Andy Hassall / <andy@andyh.co. uk> / <http://www.andyh.co.uk >
    <http://www.andyhsoftwa re.co.uk/space> Space: disk usage analysis tool

    Comment

    • Jerry Sievers

      #3
      Re: stderr from &quot;system&qu ot; should be logged?

      Andy Hassall <andy@andyh.co. uk> writes:
      [color=blue]
      > On 13 Jan 2005 10:15:15 -0500, Jerry Sievers <jerry@jerrysie vers.com> wrote:
      >
      > Redirecting it to what, stdout? Wouldn't that be expected behaviour?
      >
      >
      > Could you give an example line of code to show what you're redirecting to
      > where?[/color]

      The test cases;

      system('echo foo >&2');

      Ok. What's the cause of this problem I found is that the error stream
      of system commands does indeed get logged. However, the data is going
      to the system wide error_log and not the virtual host specific log
      where most of the PHP errors for this VH instance are written.

      Interesting. Case closed... as long as the errors are being logged
      somewhere, this is good enough for now.

      Anyone that knows how I would get these errors into a VH specific
      error_log file, please chime in here.

      Thanks.

      --
      -------------------------------------------------------------------------------
      Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
      305 321-1144 (mobile http://www.JerrySievers.com/

      Comment

      Working...