You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jacek Prucia <ja...@7bulls.com> on 2001/11/14 19:31:16 UTC

mod_proxy logs

	Hi all,

 I've recently bumped into some wacky kind of problem with Apache 1.3.x that might require writting a patch. If I have mod_proxy enabled then all requests (proxy & non proxy) are logged to coresponding CustomLog/TransferLog file (with selected format). On a busy server this can make access logs consume quite a lot of disk space. Looks like there's no way to split proxy logs from access logs or even discard them at all. This could be solved by doing either:

1. Adding Request_URL attribute to mod_setenvif.c like this:

SetEnvIf Request_URL "^http\:\/\/" proxy_request
CustomLog "/path/to/access.log" common env=!proxy_request
CustomLog "/path/to/proxy.log" common env=proxy_request

2. Adding ProxyLog directive to mod_log_config.c like this:

ProxyLog file|pipe format-srting|format-name [env stuff]

...then log to that file if r->proxyreq is true.

3. This is documented somewhere else and I'm just wasting developer time instead of just RTFM (hopefully not)

This problems bugs me directly, so I'm willing to write patch. However since I came up with a number of ways to solve that problem I would like to see developer approval/vetos before I try to shoot myself in the foot for free ;))

-- 
Jacek Prucia
7bulls.com S.A.


Re: mod_proxy logs

Posted by Jacek Prucia <ja...@7bulls.com>.
Graham Leggett <mi...@sharp.fm> wrote:

> Jacek Prucia wrote:
> >  I've recently bumped into some wacky kind of problem with Apache
> > 1.3.x that might require writting a patch. If I have mod_proxy
> > enabled then all requests (proxy & non proxy) are logged to
> > coresponding CustomLog/TransferLog file (with selected format). On
> > a busy server this can make access logs consume quite a lot of disk
> > space. Looks like there's no way to split proxy logs from access
> > logs or even discard them at all. This could be solved by doing either:
> 
> Are you trying to run a forward proxy and a webserver at the same time?

Yes.

> If so, why not use different customlogs within virtual hosts to split
> out the webserver logs from the proxy logs? (instead of trying to split
> the proxy logs from the webserver logs).

In other words: the solution is to split servers, not logs.

> The proxy logs just go in the default logfile, while the webserver logs
> can go into separate logfiles

I did a little test the other way: default log file gets webserver requests and proxy has dedicated VirtualHost with separate log file. It works as expected.

> no patching required.

Yes, but even when your explanation seems logical (separating servers doing different things) and creating name-based Virtual Host is quick'n'easy -- this still doesn't fit very well my situation (there's a lot of explanation why and I feel that it is really unnecesary to clutter this list with my problems). I'll probably go ahead and make this patch, but since it only fits my particular needs, it looks like there's no need to import it into main trunk.

regards,
-- 
Jacek Prucia
7bulls.com S.A.



Re: mod_proxy logs

Posted by Graham Leggett <mi...@sharp.fm>.
Jacek Prucia wrote:

>  I've recently bumped into some wacky kind of problem with Apache
> 1.3.x that might require writting a patch. If I have mod_proxy
> enabled then all requests (proxy & non proxy) are logged to
> coresponding CustomLog/TransferLog file (with selected format). On
> a busy server this can make access logs consume quite a lot of disk
> space. Looks like there's no way to split proxy logs from access
> logs or even discard them at all. This could be solved by doing either:

Are you trying to run a forward proxy and a webserver at the same time?
If so, why not use different customlogs within virtual hosts to split
out the webserver logs from the proxy logs? (instead of trying to split
the proxy logs from the webserver logs).

The proxy logs just go in the default logfile, while the webserver logs
can go into separate logfiles - no patching required.

Regards,
Graham
-- 
-----------------------------------------
minfrin@sharp.fm		"There's a moon
					over Bourbon Street
						tonight..."