Re: how to prevent logging of proxy requests?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: how to prevent logging of proxy requests?

Peter Ruprecht
> >
> > 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.
>
> Joost
>

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

 -Peter

---------------------------------------------------------------------
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Re: how to prevent logging of proxy requests?

Joshua Slive
On 4/26/05, Peter Ruprecht <[hidden email]> wrote:

> or if you want to discard log entries from proxy requests:
> CustomLog /dev/null combined env=proxy-request

Woh.  That's really inefficient.  Just drop the line and the log won't
be written.

Joshua.

---------------------------------------------------------------------
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: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...