sending all of stderr to a process

2009-04-03 Thread E R
I want to send all error output to a process for specialized logging. I know that you can use CustomLog with a pipe. However, will that capture output from things like 'print STDERR ...' or if an XS module directly writes to stderr? I need that output to also go to my logging process. Does anyone

Re: sending all of stderr to a process

2009-04-03 Thread Torsten Foertsch
On Fri 03 Apr 2009, E R wrote: > I want to send all error output to a process for specialized logging. > I know that you can use CustomLog with a pipe. However, will that > capture output from things like 'print STDERR ...' or if an XS module > directly writes to stderr? I need that output to also

Re: sending all of stderr to a process

2009-04-04 Thread E R
One operational issue with this is that if the logger process dies, existing httpd processes will get a SIGPIPE signal on subsequent writes. Restarting the logger process does not restore the lost connections. On Fri, Apr 3, 2009 at 12:38 PM, Torsten Foertsch wrote: > On Fri 03 Apr 2009, E R wro

Re: sending all of stderr to a process

2009-04-05 Thread Torsten Foertsch
On Sat 04 Apr 2009, E R wrote: > One operational issue with this is that if the logger process dies, > existing httpd processes will get a SIGPIPE signal on subsequent > writes. Restarting the logger process does not restore the lost > connections. > > > On Fri, Apr 3, 2009 at 12:38 PM, Torsten Foe

Re: sending all of stderr to a process

2009-04-05 Thread Perrin Harkins
On Fri, Apr 3, 2009 at 1:22 PM, E R wrote: > I want to send all error output to a process for specialized logging. > I know that you can use CustomLog with a pipe. However, will that > capture output from things like 'print STDERR ...' or if an XS module > directly writes to stderr? I need that ou

Re: sending all of stderr to a process

2009-04-05 Thread E R
Hi Torsten, On Sun, Apr 5, 2009 at 4:13 AM, Torsten Foertsch wrote: > > And later on it does not check the return code when writing the log: > > httpd-2.2.11/server/log.c:682: >        apr_file_puts(errstr, logf); >        apr_file_flush(logf); My concern is about what happens in this scenario:

Re: sending all of stderr to a process

2009-04-06 Thread Torsten Foertsch
On Sun 05 Apr 2009, E R wrote: > My concern is about what happens in this scenario: > > 1. Set everything up (named pipe, logger process, etc.) > 2. Now suppose the logger process dies (it crashes or I need to > restart it) 3. Any writes through existing connections to the named > pipe will just fa

Re: sending all of stderr to a process

2009-04-06 Thread André Warnier
Torsten Foertsch wrote: [...] On Linux the ErrorLog of the base server is always opened on file descriptor 2 that means stderr. So, a reader that reads this stream gets everything (under normal conditions) that Apache, Perl or any XS module writes to stderr. Hi Torsten, just jumping in her

Re: sending all of stderr to a process

2009-04-06 Thread Torsten Foertsch
On Mon 06 Apr 2009, André Warnier wrote: > How does it work with Apache children/threads that may be acting as a > VirtualHost's having their own ErrorLog ? > My experience is that anything logged by mod_perl modules running > "in" a VirtualHost using explicit warn() or $r->log_error() or > $r->log