> > Hi,
> > I'm running apache 2.0.46 on RedHat Enterprise 3, with a normal web site
> > and also a proxy server on the same host. I would like to separate the
> > logging of proxy requests from the requests for the web site itself. If
> > there's a way to completely disable logging for proxy requests that would
> > be even better.
> > I have played around a little bit with custom logging but it seems like
> > an inelegant way to address what I want to do ... unless of course I
> > haven't set it up in a smart way!
> Use SetEnvIf to separate the logging. See
> http://httpd.apache.org/docs-2.0/mod/mod_log_config.html#customlog at the
> end of the CustomLog directive.
Thanks for the pointer. This kind of construction seems to work pretty well:
# see whether the Proxy-Connection HTTP header is set; if so set
# apache environment variable
SetEnvIf Proxy-Connection ^[a-zA-Z].* proxy-request
CustomLog logs/access_log_proxy combined env=proxy-request
CustomLog logs/access_log combined env=!proxy-request
or if you want to discard log entries from proxy requests:
CustomLog /dev/null combined env=proxy-request