Again, this is for the non-mod-perl cgi handler, so sorry, but
it finishes off the question, because apparently there's not a
damn thing I can do about it:

http://httpd.apache.org/docs/2.0/logs.html

"The first item in the log entry is the date and time of the
message. The second entry lists the severity of the error being
reported. The LogLevel directive is used to control the types of
errors that are sent to the error log by restricting the
severity level. The third entry gives the IP address of the
client that generated the error. ... It is not possible to
customize the error log by adding or removing information."

WHY WHY WHY?

This works well for me as an error log pipe:

#!/usr/bin/perl

use strict;
use warnings;

open LAME, '>>', '/var/log/apache2/lame.log';

select LAME;
$| = 1;

while () {
s{ \A \[.*?\] \s* \[.*?\] \s* \[.*?\] }{}xms;
s{ , \s referer: \s http:// .*? \z }{}xms;
print LAME $_;
}


On Fri, 11 Aug 2006, Mark Hedges wrote:

> From: Mark Hedges
> To: Philip M. Gollucci
> Cc: modperl@perl.apache.org
> Date: Fri, 11 Aug 2006 17:47:19 -0700 (PDT)
> Subject: Re: turn off error_log formatting under standard cgi handler?
>
>
>
> On Fri, 11 Aug 2006, Philip M. Gollucci wrote:
> >
> > Mark Hedges wrote:
> > > Maybe this is a regular apache users list question, sorry, but I figure
> > > someone here might now.
> > >
> > > Server: Apache/2.0.55 (Debian) mod_apreq2-20051231/2.5.7 mod_perl/2.0.2
> > > Perl/v5.8.8
> > >
> > > Using the regular cgi handler (no mod_perl fancy stuff), my warning messages
> > > have this format:
> > >
> > > [Fri Aug 11 13:25:03 2006] [error] [client 127.0.0.1] ---, referer:
> > > http://localhost/the_http_referer_page.html

> > LogLevel debug
> > ErrorLog logs/error_log
> > LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""
> > combined
> > LogFormat "%h %l %u %t \"%r\" %>s %b" common
> > CustomLog logs/access_log common
> > CustomLog logs/access_log combined

>
> That would be awesome if it helped me, but it does not.
>
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] , referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] this, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] is, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] a, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] test, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] of, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] the, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] emergency, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] broadcast, referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] system., referer: http://localhost/cgi-bin/mycart.cgi
> [Fri Aug 11 17:44:31 2006] [error] [client 127.0.0.1] at /usr/lib/cgi-bin/mycart.cgi line 57., referer: http://localhost/cgi-bin/mycart.cgi
>
>
> Like I said, it's the error log that is the problem, not the
> access log.
>
> I want to OMIT the date/loglevel/client before the warning lines
> and to OMIT the referer after them. I want STDERR to be clean.
>
> Here's an interesting behavior -- it always prints the prepended
> info, but it only prints the appended referer on POST, not on GET.
>
> Mark
>
>
>