comparison 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
comparison
equal deleted inserted replaced
1167:cac06b81957c 1168:384bb0349a8a
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_log_module" 10 <module name="Module ngx_http_log_module"
11 link="/en/docs/http/ngx_http_log_module.html" 11 link="/en/docs/http/ngx_http_log_module.html"
12 lang="en" 12 lang="en"
13 rev="11"> 13 rev="12">
14 14
15 <section id="summary"> 15 <section id="summary">
16 16
17 <para> 17 <para>
18 The <literal>ngx_http_log_module</literal> module writes request logs 18 The <literal>ngx_http_log_module</literal> module writes request logs
49 <directive name="access_log"> 49 <directive name="access_log">
50 <syntax> 50 <syntax>
51 <value>path</value> 51 <value>path</value>
52 [<value>format</value> 52 [<value>format</value>
53 [<literal>buffer</literal>=<value>size</value> 53 [<literal>buffer</literal>=<value>size</value>
54 [<literal>flush</literal>=<value>time</value>]]]</syntax> 54 [<literal>flush</literal>=<value>time</value>]]
55 [<literal>if</literal>=<value>condition</value>]]</syntax>
55 <syntax> 56 <syntax>
56 <value>path</value> 57 <value>path</value>
57 <value>format</value> 58 <value>format</value>
58 <literal>gzip[=<value>level</value>]</literal> 59 <literal>gzip[=<value>level</value>]</literal>
59 [<literal>buffer</literal>=<value>size</value>] 60 [<literal>buffer</literal>=<value>size</value>]
60 [<literal>flush</literal>=<value>time</value>]</syntax> 61 [<literal>flush</literal>=<value>time</value>]
62 [<literal>if</literal>=<value>condition</value>]</syntax>
61 <syntax> 63 <syntax>
62 <literal>syslog:</literal><literal>server</literal>=<value>address</value>[,<value>parameter</value>=<value>value</value>] 64 <literal>syslog:</literal><literal>server</literal>=<value>address</value>[,<value>parameter</value>=<value>value</value>]
63 [<value>format</value>]</syntax> 65 [<value>format</value>
66 [<literal>if</literal>=<value>condition</value>]]</syntax>
64 <syntax><literal>off</literal></syntax> 67 <syntax><literal>off</literal></syntax>
65 <default>logs/access.log combined</default> 68 <default>logs/access.log combined</default>
66 <context>http</context> 69 <context>http</context>
67 <context>server</context> 70 <context>server</context>
68 <context>location</context> 71 <context>location</context>
174 ... 177 ...
175 </example> 178 </example>
176 </listitem> 179 </listitem>
177 180
178 </list> 181 </list>
182 </para>
183
184 <para>
185 The <literal>if</literal> parameter (1.7.0) enables conditional logging.
186 A request will not be logged if the <value>condition</value> evaluates to “0”
187 or an empty string.
188 In the following example, the requests with response codes 2xx and 3xx
189 will not be logged:
190 <example>
191 map $status $loggable {
192 ~^[23] 0;
193 default 1;
194 }
195
196 access_log /path/to/access.log combined if=$loggable;
197 </example>
179 </para> 198 </para>
180 199
181 <para> 200 <para>
182 The following parameters configure logging to syslog: 201 The following parameters configure logging to syslog:
183 <list type="tag"> 202 <list type="tag">