You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Brian Candler <B....@pobox.com> on 2005/08/02 14:59:54 UTC

[users@httpd] Virtualising 'ErrorLog'

I can easily set up access logs such that the Host: header is included; this
allows the logs to kept in a single file and then post-filtered to separate
them out per virtual user. e.g.

LogFormat "%{Host}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined

However, is there a way to do the same for ErrorLog? That is, without having
to set up a <VirtualHost> container for each site (since I'm using
mod_rewrite for mass virtual hosting). In particular, I want each site's CGI
stderr output to be filterable.

Thanks,

Brian.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Virtualising 'ErrorLog'

Posted by Brian Candler <B....@pobox.com>.
On Tue, Aug 02, 2005 at 09:15:11AM -0400, Dan Mahoney, System Admin wrote:
> >However, is there a way to do the same for ErrorLog? That is, without 
> >having
> >to set up a <VirtualHost> container for each site (since I'm using
> >mod_rewrite for mass virtual hosting). In particular, I want each site's 
> >CGI
> >stderr output to be filterable.
> 
> http://www.blinkenlights.nl/apache/
> 
> http://www.gluelogic.com/code/apache/
> 
> Just for starters.

Hmm. It seems to me that these only work for Apache's own errors. If you
write a CGI which does (say)

    print STDERR "I was called from $ENV{'REMOTE_ADDR'}\n";

then all you get in the error log is

"I was called from 127.0.0.1"

and it is not prefixed by
[Mon Aug  8 12:33:37 2005] [error] [client 127.0.0.1] 
as Apache's own messages are.

It looke like the CGI script is given the errorlog filehandle directly as
its stderr:

        /* Script output to stderr is already directed to the error log
         * on Unix, thanks to the magic of fork().
         */

So AFAICT, some more substantial modifications are needed to make this work
with CGI stderr output.

Got any more pointers?

Thanks,

Brian.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Virtualising 'ErrorLog'

Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Tue, 2 Aug 2005, Brian Candler wrote:

> I can easily set up access logs such that the Host: header is included; this
> allows the logs to kept in a single file and then post-filtered to separate
> them out per virtual user. e.g.
>
> LogFormat "%{Host}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
>
> However, is there a way to do the same for ErrorLog? That is, without having
> to set up a <VirtualHost> container for each site (since I'm using
> mod_rewrite for mass virtual hosting). In particular, I want each site's CGI
> stderr output to be filterable.

http://www.blinkenlights.nl/apache/

http://www.gluelogic.com/code/apache/

Just for starters.

>
> Thanks,
>
> Brian.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
>

--

"She's NOT my girlfriend!"

-Dan Mahoney, Quite a bit recently.

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM
Site:  http://www.gushi.org
---------------------------


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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: [users@httpd] Virtualising 'ErrorLog'

Posted by "Dan Mahoney, System Admin" <da...@prime.gushi.org>.
On Tue, 2 Aug 2005, Brian Candler wrote:

I saw a set of patches a while ago for this, that someone had written 
around the time of 1.3.28-1.3.29

If you can't find them, I may still have them and/or the email address of 
the author.

-Dan

> I can easily set up access logs such that the Host: header is included; this
> allows the logs to kept in a single file and then post-filtered to separate
> them out per virtual user. e.g.
>
> LogFormat "%{Host}i %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
>
> However, is there a way to do the same for ErrorLog? That is, without having
> to set up a <VirtualHost> container for each site (since I'm using
> mod_rewrite for mass virtual hosting). In particular, I want each site's CGI
> stderr output to be filterable.
>
> Thanks,
>
> Brian.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> 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
>

--

"It doesn't matter where I live, because I live in dataspace.  That's my
hometown."

-Steve Roberts, Builder of BEHEMOTH

--------Dan Mahoney--------
Techie,  Sysadmin,  WebGeek
Gushi on efnet/undernet IRC
ICQ: 13735144   AIM: LarpGM
Site:  http://www.gushi.org
---------------------------


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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