annotate xml/en/docs/stream/ngx_stream_log_module.xml @ 1777:8b1ef02c8686

Corrected examples in ngx_stream_log_module.
author Yaroslav Zhuravlev <yar@nginx.com>
date Fri, 09 Sep 2016 18:51:33 +0300
parents 8d0372178e00
children c36eb5d34651
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
1 <?xml version="1.0"?>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
2
580
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 452
diff changeset
3 <!--
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 452
diff changeset
4 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 452
diff changeset
5 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 452
diff changeset
6
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
9 <module name="Module ngx_stream_log_module"
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
10 link="/en/docs/stream/ngx_stream_log_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
11 lang="en"
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
12 rev="1">
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
13
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14 <section id="summary">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16 <para>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
17 The <literal>ngx_stream_log_module</literal> module writes session logs
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
18 in the specified format.
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
19 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21 </section>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24 <section id="example" name="Example Configuration">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 <para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27 <example>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
28 log_format basic '$remote_addr [$time_local] '
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
29 '$protocol $status $bytes_sent $bytes_received '
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
30 '$session_time';
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31
1777
8b1ef02c8686 Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1776
diff changeset
32 access_log /spool/logs/nginx-access.log basic buffer=32k;
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 </example>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36 </section>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
39 <section id="directives" name="Directives">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
40
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
41 <directive name="access_log">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
42 <syntax>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
43 <value>path</value>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
44 <value>format</value>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
45 [<literal>buffer</literal>=<value>size</value>]
1694
080b36ad8d76 Reduced syntax clutter in the access_log directive.
Maxim Dounin <mdounin@mdounin.ru>
parents: 1285
diff changeset
46 [<literal>gzip[=<value>level</value>]</literal>]
1168
384bb0349a8a Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
47 [<literal>flush</literal>=<value>time</value>]
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
48 [<literal>if</literal>=<value>condition</value>]</syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
49 <syntax><literal>off</literal></syntax>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
50 <default>off</default>
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
51 <context>stream</context>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
52 <context>server</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
54 <para>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
55 Sets the path, <link id="log_format">format</link>,
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
56 and configuration for a buffered log write.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57 Several logs can be specified on the same level.
1285
4e89518a5999 Moved syslog configuration details into the separate documents.
Ruslan Ermilov <ru@nginx.com>
parents: 1205
diff changeset
58 Logging to <link doc="../syslog.xml">syslog</link>
4e89518a5999 Moved syslog configuration details into the separate documents.
Ruslan Ermilov <ru@nginx.com>
parents: 1205
diff changeset
59 can be configured by specifying
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 939
diff changeset
60 the “<literal>syslog:</literal>” prefix in the first parameter.
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
61 The special value <literal>off</literal> cancels all
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
62 <literal>access_log</literal> directives on the current level.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
63 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
64
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
65 <para>
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
66 If either the <literal>buffer</literal> or <literal>gzip</literal>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
67 parameter is used, writes to log will be buffered.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
68 <note>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
69 The buffer size must not exceed the size of an atomic write to a disk file.
657
56fa3cab4ceb Completely dropped FreeBSD version information when talking about
Ruslan Ermilov <ru@nginx.com>
parents: 656
diff changeset
70 For FreeBSD this size is unlimited.
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
71 </note>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
72 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
73
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
74 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
75 When buffering is enabled, the data will be written to the file:
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
76 <list type="bullet">
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
77
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
78 <listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
79 if the next log line does not fit into the buffer;
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
80 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
81
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
82 <listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
83 if the buffered data is older than specified by the <literal>flush</literal>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
84 parameter;
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
85 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
86
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
87 <listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
88 when a worker process is <link doc="../control.xml">re-opening</link> log
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
89 files or is shutting down.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
90 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
91
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
92 </list>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
93 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
94
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
95 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
96 If the <literal>gzip</literal> parameter is used, then the buffered data will
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
97 be compressed before writing to the file.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
98 The compression level can be set between 1 (fastest, less compression)
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
99 and 9 (slowest, best compression).
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
100 By default, the buffer size is equal to 64K bytes, and the compression level
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
101 is set to 1.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
102 Since the data is compressed in atomic blocks, the log file can be decompressed
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
103 or read by “<literal>zcat</literal>” at any time.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
104 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
105
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
106 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
107 Example:
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
108 <example>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
109 access_log /path/to/log.gz basic gzip flush=5m;
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
110 </example>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
111 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
112
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
113 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
114 <note>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
115 For gzip compression to work, nginx must be built with the zlib library.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
116 </note>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
117 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
118
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119 <para>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
120 The file path can contain variables,
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121 but such logs have some constraints:
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122 <list type="bullet">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 <listitem>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
125 the <link doc="../ngx_core_module.xml" id="user"/>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
126 whose credentials are used by worker processes should
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
127 have permissions to create files in a directory with
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
128 such logs;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129 </listitem>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
131 <listitem>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
132 buffered writes do not work;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
133 </listitem>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
134
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
135 <listitem>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
136 the file is opened and closed for each log write.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
137 However, since the descriptors of frequently used files can be stored
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
138 in a <link id="open_log_file_cache">cache</link>, writing to the old file
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
139 can continue during the time specified by the <link id="open_log_file_cache"/>
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
140 directive’s <literal>valid</literal> parameter
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
141 </listitem>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
142
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
143 </list>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
144 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
145
953
aded7086e84f Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents: 939
diff changeset
146 <para>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
147 The <literal>if</literal> parameter enables conditional logging.
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
148 A session will not be logged if the <value>condition</value> evaluates to “0”
1168
384bb0349a8a Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
149 or an empty string.
384bb0349a8a Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
150 </para>
384bb0349a8a Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
151
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152 </directive>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
154
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
155 <directive name="log_format">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
156 <syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
157 <value>name</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
158 <value>string</value> ...</syntax>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
159 <default></default>
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
160 <context>stream</context>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
161
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
162 <para>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
163 Specifies the log format, for example:
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
164 <example>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
165 log_format proxy '$remote_addr [$time_local] '
1777
8b1ef02c8686 Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1776
diff changeset
166 '$protocol $status $bytes_sent $bytes_received '
8b1ef02c8686 Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1776
diff changeset
167 '$session_time "$upstream_addr" '
8b1ef02c8686 Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1776
diff changeset
168 '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connection_time"';
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
169 </example>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
170 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
171
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
172 </directive>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
174
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
175 <directive name="open_log_file_cache">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
176
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
177 <syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
178 <literal>max</literal>=<value>N</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
179 [<literal>inactive</literal>=<value>time</value>]
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
180 [<literal>min_uses</literal>=<value>N</value>]
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
181 [<literal>valid</literal>=<value>time</value>]</syntax>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
182 <syntax><literal>off</literal></syntax>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
183 <default>off</default>
1776
8d0372178e00 Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1694
diff changeset
184 <context>stream</context>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
185 <context>server</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
186
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
187 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
188 Defines a cache that stores the file descriptors of frequently used logs
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
189 whose names contain variables.
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
190 The directive has the following parameters:
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
191 <list type="tag">
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
192
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
193 <tag-name><literal>max</literal></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
194 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
195 sets the maximum number of descriptors in a cache;
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
196 if the cache becomes full the least recently used (LRU)
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
197 descriptors are closed
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
198 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
199
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
200 <tag-name><literal>inactive</literal></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
201 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
202 sets the time after which the cached descriptor is closed
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
203 if there were no access during this time;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
204 by default, 10 seconds
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
205 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
206
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
207 <tag-name><literal>min_uses</literal></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
208 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
209 sets the minimum number of file uses during the time
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
210 defined by the <literal>inactive</literal> parameter
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
211 to let the descriptor stay open in a cache;
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
212 by default, 1
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
213 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
214
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
215 <tag-name><literal>valid</literal></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
216 <tag-desc>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
217 sets the time after which it should be checked that the file
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
218 still exists with the same name; by default, 60 seconds
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
219 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
220
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
221 <tag-name><literal>off</literal></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
222 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
223 disables caching
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
224 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
225
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
226 </list>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
227 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
228
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
229 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 956
diff changeset
230 Usage example:
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
231 <example>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
232 open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
233 </example>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
234 </para>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
235
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
236 </directive>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
237
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
238 </section>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
239
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
240 </module>