Mercurial > hg > nginx-site
diff xml/en/docs/http/ngx_http_log_module.xml @ 1168:384bb0349a8a
Documented the "if" parameter of the "access_log" directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 24 Apr 2014 12:25:59 +0400 |
parents | 07402a11fd8d |
children | aab8a1667171 |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_log_module.xml Thu Apr 24 09:02:47 2014 +0400 +++ b/xml/en/docs/http/ngx_http_log_module.xml Thu Apr 24 12:25:59 2014 +0400 @@ -10,7 +10,7 @@ <module name="Module ngx_http_log_module" link="/en/docs/http/ngx_http_log_module.html" lang="en" - rev="11"> + rev="12"> <section id="summary"> @@ -51,16 +51,19 @@ <value>path</value> [<value>format</value> [<literal>buffer</literal>=<value>size</value> - [<literal>flush</literal>=<value>time</value>]]]</syntax> + [<literal>flush</literal>=<value>time</value>]] + [<literal>if</literal>=<value>condition</value>]]</syntax> <syntax> <value>path</value> <value>format</value> <literal>gzip[=<value>level</value>]</literal> [<literal>buffer</literal>=<value>size</value>] - [<literal>flush</literal>=<value>time</value>]</syntax> + [<literal>flush</literal>=<value>time</value>] + [<literal>if</literal>=<value>condition</value>]</syntax> <syntax> <literal>syslog:</literal><literal>server</literal>=<value>address</value>[,<value>parameter</value>=<value>value</value>] - [<value>format</value>]</syntax> + [<value>format</value> + [<literal>if</literal>=<value>condition</value>]]</syntax> <syntax><literal>off</literal></syntax> <default>logs/access.log combined</default> <context>http</context> @@ -179,6 +182,22 @@ </para> <para> +The <literal>if</literal> parameter (1.7.0) enables conditional logging. +A request will not be logged if the <value>condition</value> evaluates to “0” +or an empty string. +In the following example, the requests with response codes 2xx and 3xx +will not be logged: +<example> +map $status $loggable { + ~^[23] 0; + default 1; +} + +access_log /path/to/access.log combined if=$loggable; +</example> +</para> + +<para> The following parameters configure logging to syslog: <list type="tag">