Mercurial > hg > nginx-site
annotate xml/ru/docs/stream/ngx_stream_log_module.xml @ 2028:5c55b7054b58
Updated docs for the upcoming NGINX Plus release.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Sat, 26 Aug 2017 00:56:05 +0300 |
parents | 0b339643b08f |
children | dab82d534f0f |
rev | line source |
---|---|
222
bfe3eff81d04
Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
1 <?xml version="1.0"?> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
507
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
507
diff
changeset
|
4 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
507
diff
changeset
|
5 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
507
diff
changeset
|
6 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
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="Модуль ngx_stream_log_module" |
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
10 link="/ru/docs/stream/ngx_stream_log_module.html" |
589 | 11 lang="ru" |
1884
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
12 rev="5"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 |
110
40eec261c2a6
Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents:
106
diff
changeset
|
14 <section id="summary"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 <para> |
1791
c36eb5d34651
Added appeared-in version for ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1777
diff
changeset
|
17 Модуль <literal>ngx_stream_log_module</literal> (1.11.4) записывает логи сессий |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
18 в указанном формате. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
24 <section id="example" name="Пример конфигурации"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
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 ' |
1777
8b1ef02c8686
Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1776
diff
changeset
|
30 '$session_time'; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
32 access_log /spool/logs/nginx-access.log basic buffer=32k; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
39 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 <directive name="access_log"> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
42 <syntax> |
364 | 43 <value>путь</value> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
44 <value>формат</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>размер</value>] |
1694
080b36ad8d76
Reduced syntax clutter in the access_log directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1285
diff
changeset
|
46 [<literal>gzip[=<value>степень</value>]</literal>] |
1176
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
47 [<literal>flush</literal>=<value>время</value>] |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
48 [<literal>if</literal>=<value>условие</value>]</syntax> |
271 | 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:
222
diff
changeset
|
52 <context>server</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
53 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 <para> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
55 Задаёт путь, <link id="log_format">формат</link> |
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
56 и настройки буферизованной записи в лог. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
57 На одном уровне может использоваться несколько логов. |
1285
4e89518a5999
Moved syslog configuration details into the separate documents.
Ruslan Ermilov <ru@nginx.com>
parents:
1205
diff
changeset
|
58 Запись в <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 настраивается указанием префикса |
1175
a05d9fa73ce2
Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1155
diff
changeset
|
60 “<literal>syslog:</literal>” в первом параметре. |
271 | 61 Специальное значение <literal>off</literal> отменяет все директивы |
62 <literal>access_log</literal> для текущего уровня. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
63 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
64 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
65 <para> |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
66 Если задан размер буфера с помощью параметра <literal>buffer</literal> или |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
67 указан параметр <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
|
68 буферизованной. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
69 <note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 Размер буфера должен быть не больше размера атомарной записи в дисковый файл. |
657
56fa3cab4ceb
Completely dropped FreeBSD version information when talking about
Ruslan Ermilov <ru@nginx.com>
parents:
656
diff
changeset
|
71 Для FreeBSD этот размер неограничен. |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
72 </note> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
73 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
74 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
75 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
76 При включённой буферизации данные записываются в файл: |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
77 <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
|
78 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
79 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
80 если очередная строка лога не помещается в буфер; |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
81 </listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
82 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
83 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
84 если данные в буфере находятся дольше интервала времени, заданного |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
85 параметром <literal>flush</literal>; |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
86 </listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
87 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
88 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
89 при <link doc="../control.xml">переоткрытии</link> лог-файла или |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
90 завершении рабочего процесса. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
91 </listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
92 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
93 </list> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
94 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
95 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
96 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
97 Если задан параметр <literal>gzip</literal>, то буфер будет сжиматься перед |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
98 записью в файл. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
99 Степень сжатия может быть задана в диапазоне от 1 (быстрее, но хуже сжатие) |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
100 до 9 (медленнее, но лучше сжатие). |
966 | 101 По умолчанию используются буфер размером 64К байт и степень сжатия 1. |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
102 Данные сжимаются атомарными блоками, и в любой момент времени лог-файл может |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
103 быть распакован или прочитан с помощью утилиты “<literal>zcat</literal>”. |
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 Пример: |
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 Для поддержки gzip-сжатия логов nginx должен быть собран с библиотекой zlib. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
116 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
117 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
118 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
119 <para> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
120 В пути файла можно использовать переменные, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
121 но такие логи имеют некоторые ограничения: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
122 <list type="bullet"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
123 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
124 <listitem> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
125 <link doc="../ngx_core_module.xml" id="user">пользователь</link>, |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
126 с правами которого работают рабочие процессы, должен |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 иметь права на создание файлов в каталоге с такими логами; |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
129 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 <listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 не работает буферизация; |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 <listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 файл открывается для каждой записи в лог и сразу же после записи закрывается. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
136 Следует однако иметь в виду, что поскольку дескрипторы часто используемых файлов |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
137 могут храниться в <link id="open_log_file_cache">кэше</link>, |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
138 то при вращении логов в течение времени, заданного параметром |
271 | 139 <literal>valid</literal> директивы <link id="open_log_file_cache"/>, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
140 запись может продолжаться в старый файл. |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
143 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
144 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 |
1175
a05d9fa73ce2
Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1155
diff
changeset
|
146 <para> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
147 Параметр <literal>if</literal> включает условную запись в лог. |
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
148 Сессия не будет записываться в лог, если результатом вычисления |
1176
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
149 <value>условия</value> является “0” или пустая строка. |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
150 </para> |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
151 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
152 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
153 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
154 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
155 <directive name="log_format"> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
156 <syntax> |
271 | 157 <value>название</value> |
1884
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
158 [<literal>escape</literal>=<literal>default</literal>|<literal>json</literal>] |
271 | 159 <value>строка</value> ...</syntax> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
160 <default></default> |
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
161 <context>stream</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
162 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
163 <para> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
164 Задаёт формат лога, например: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
165 <example> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
166 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
|
167 '$protocol $status $bytes_sent $bytes_received ' |
8b1ef02c8686
Corrected examples in ngx_stream_log_module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1776
diff
changeset
|
168 '$session_time "$upstream_addr" ' |
1794
19eb203ffd41
Corrected variable name in the log module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1791
diff
changeset
|
169 '"$upstream_bytes_sent" "$upstream_bytes_received" "$upstream_connect_time"'; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
170 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
171 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
172 |
1874
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
173 <para id="log_format_escape"> |
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
174 Параметр <literal>escape</literal> (1.11.8) позволяет задать |
1884
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
175 экранирование символов <literal>json</literal> или <literal>default</literal> |
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
176 в переменных, по умолчанию используется <literal>default</literal>. |
1874
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
177 </para> |
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
178 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
179 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
180 |
364 | 181 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
182 <directive name="open_log_file_cache"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
183 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
184 <syntax> |
271 | 185 <literal>max</literal>=<value>N</value> |
186 [<literal>inactive</literal>=<value>время</value>] | |
187 [<literal>min_uses</literal>=<value>N</value>] | |
188 [<literal>valid</literal>=<value>время</value>]</syntax> | |
189 <syntax><literal>off</literal></syntax> | |
102
c76a257f3fd4
The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents:
79
diff
changeset
|
190 <default>off</default> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
191 <context>stream</context> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
192 <context>server</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
193 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
194 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
195 Задаёт кэш, в котором хранятся дескрипторы файлов часто используемых |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
196 логов, имена которых заданы с использованием переменных. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
197 Параметры директивы: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
198 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
199 |
271 | 200 <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:
222
diff
changeset
|
201 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
202 задаёт максимальное число дескрипторов в кэше; |
507 | 203 при переполнении кэша наименее востребованные (LRU) |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
204 дескрипторы закрываются |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
205 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
206 |
271 | 207 <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:
222
diff
changeset
|
208 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
209 задаёт время, после которого закэшированный дескриптор закрывается, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
210 если к нему не было обращений в течение этого времени; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
211 по умолчанию 10 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
212 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
213 |
271 | 214 <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:
222
diff
changeset
|
215 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
216 задаёт минимальное число использований файла в течение |
271 | 217 времени, заданного параметром <literal>inactive</literal>, |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
218 после которого дескриптор файла будет оставаться открытым в кэше; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
219 по умолчанию 1 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
220 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
221 |
271 | 222 <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:
222
diff
changeset
|
223 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
224 задаёт, через какое время нужно проверять, что файл ещё |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
225 существует под тем же именем; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
226 по умолчанию 60 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
227 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
228 |
271 | 229 <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:
222
diff
changeset
|
230 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
231 запрещает кэш |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
232 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
233 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
234 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
235 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
236 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
238 Пример использования: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
239 <example> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
240 open_log_file_cache max=1000 inactive=20s valid=1m min_uses=2; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
241 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
242 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
243 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
244 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
245 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
246 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
247 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
248 </module> |