You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jeremy Hilton <je...@adtcs.com> on 2005/01/26 16:34:43 UTC

[users@httpd] Piped Logs Problem

Hello all,

I am trying to implement piped logs in Apache 2.0.52, but to no avail.
Specifically, I am trying to pipe logs to a perl script. Eventually the perl
script will do some processing then print the logs back to STDOUT for piping
to cronolog. For now, however, the perl script simply attempts to print
STDIN to STDOUT so I can redirect into a text file.

I should note that I have successfully implemented this on 1.3.27.

My CustomLog directive is in a virtualhost tag and reads as

CustomLog "|/usr/local/apache/vdocs/prod/mcbandwidth.xxxxx.net/parselog.pl
>> /usr/local/apache/vdocs/prod/mcbandwidth.xxxxx.net/textlog.txt" combined

My perl script is as follows

#!/usr/bin/perl

$| = 1;

while(<STDIN>) {
        print ³$_\n²;
}

In theory, this should print STDIN to SDTOUT and redirect output into
/usr/local/apache/vdocs/prod/mcbandwidth.xxxxx.net/textlog.txt. But in
reality it isn¹t populating textlog.txt at all.

My file permissions are as such

Both my textlog.txt and parselog.pl are chmoded 777 as is the directory they
live in, so I don¹t think it is a permissions problem.

I should also note that I am pipi—g log output into cronolog on other
virtualhosts just fine, so I know the piped log mechanism works.

I have also verified that the parselog.pl shows up in ps, and if killed
apache respawns, so the reliable piped log feature works as well.

I am completely stuck!!!!!!!!!!!!!!

Jeremy Hilton