Passing variables to ErrorLog pipe
am 31.08.2009 23:00:26 von Mike Cardwell
Hi,
I'm using a pipe for my error log like this:
ErrorLog "|/web/etc/log_error_pipe.pl"
Is there any way of passing information to the pipe other than the log
entry? Specifically I'd like to pass the HTTP_HOST value to it...
--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: Passing variables to ErrorLog pipe
am 01.09.2009 12:58:20 von Mike Cardwell
Mike Cardwell wrote:
> I'm using a pipe for my error log like this:
>
> ErrorLog "|/web/etc/log_error_pipe.pl"
>
> Is there any way of passing information to the pipe other than the log
> entry? Specifically I'd like to pass the HTTP_HOST value to it...
I came up with a pretty sick solution. I set the ErrorLog to log to
syslog rather than a pipe.
Using syslog gives the error log one extra piece of useful information
which is the pid of the apache child. It also contains the client IP and
time.
So I set the CustomLog to log to a pipe, and updated the LogFormat to
include the pid, start time and end time.
So if the error log entry has a time inbetween the start/end time of the
access log entry, and it shares the same client ip and pid, then I can
link it to a particular access log entry.
I have a script tailing the syslog file gathering error log information,
and listening on a udp port for the CustomLog pipe process to send
packets containing pid/ip/start_time/end_time/HTTP_HOST
--
Mike Cardwell - IT Consultant and LAMP developer
Cardwell IT Ltd. (UK Reg'd Company #06920226) http://cardwellit.com/
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org