Conditional logging

Igor Sysoev is at rambler-co.ru
Thu Jul 19 23:53:01 MSD 2007


On Thu, Jul 19, 2007 at 03:38:06PM -0400, Paul Dlug wrote:

> On 7/19/07, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> 
> >        You can use the geo module to not log load balancer health checks
> >like this:
> >
> >   # include the load balancers we want omitted from the access log
> >   # http://wiki.codemongers.com/HWLoadbalancerCheckErrors
> >   geo $lb {
> >          default      0;
> >     10.0.0.1/32  1;   # LB IPs
> >     10.0.0.3/32  1;
> >        }
> >
> >
> ># then inside of your server {} block use this error handler:
> >
> >     error_page   400 /400;
> >     location = /400 {
> >         if ($lb) {
> >             access_log  off;
> >         }
> >         return 400;
> >     }
> 
> That's great, thanks for that. Another related question, can I disable
> a specific access log if I have multiples?

Any access_log directive at some level disables all inherited
directives:

    server {
        access_log  one;
        access_log  two;
        access_log  three;

        location /dir {
            access_log  two;
        }


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list