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 Foertsch > > <torsten.foert...@gmx.net> wrote: > > 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 > >> go to my logging process. > >> > >> Does anyone know if there an Apache module which does this? > > > > Give a named pipe's name to ErrorLog outside any virtual host. Then > > have your process read from that pipe.
At least with prefork and worker MPMs apache ignores SIGPIPE: httpd-2.2.11/server/mpm/prefork/prefork.c:406: (similar in worker.c) #ifdef SIGPIPE sa.sa_handler = SIG_IGN; if (sigaction(SIGPIPE, &sa, NULL) < 0) ap_log_error(APLOG_MARK, APLOG_WARNING, errno, ap_server_conf, "sigaction(SIGPIPE)"); #endif 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); Back in 1999-2000 apache had a reliability problem with piped loggers. Ever since I log to named pipes. Torsten -- Need professional mod_perl support? Just hire me: torsten.foert...@gmx.net