Conditional logging

Paul Dlug paul.dlug at gmail.com
Thu Jul 19 23:38:06 MSD 2007


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?





More information about the nginx mailing list