Mercurial > hg > nginx-site
annotate xml/ru/docs/stream/ngx_stream_log_module.xml @ 2729:886c6507ee04
Fixed a broken link in the Unit 1.24.0 announcement.
author | Artem Konev <artem.konev@nginx.com> |
---|---|
date | Fri, 28 May 2021 11:11:20 +0100 |
parents | eeed494bba51 |
children | 4add6ae1296f |
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" |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2540
diff
changeset
|
12 rev="8"> |
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 и настройки буферизованной записи в лог. |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2540
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> |
2111
dab82d534f0f
Documented the "none" escape mode of the "log_format" directive.
Vladimir Homutov <vl@nginx.com>
parents:
1884
diff
changeset
|
158 [<literal>escape</literal>=<literal>default</literal>|<literal>json</literal>|<literal>none</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>. |
2111
dab82d534f0f
Documented the "none" escape mode of the "log_format" directive.
Vladimir Homutov <vl@nginx.com>
parents:
1884
diff
changeset
|
177 Параметр <literal>none</literal> (1.13.10) отключает |
dab82d534f0f
Documented the "none" escape mode of the "log_format" directive.
Vladimir Homutov <vl@nginx.com>
parents:
1884
diff
changeset
|
178 экранирование символов. |
1874
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
179 </para> |
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1794
diff
changeset
|
180 |
2540
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
181 <para id="log_format_escape_default"> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
182 При использовании <literal>default</literal> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
183 символы “<literal>"</literal>”, “<literal>\</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
184 a также символы со значениями меньше 32 или больше 126 |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
185 экранируются как “<literal>\xXX</literal>”. |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
186 Если значение переменной не найдено, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
187 то в качестве значения в лог будет записываться дефис (“<literal>-</literal>”). |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
188 </para> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
189 |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
190 <para id="log_format_escape_json"> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
191 При использовании <literal>json</literal> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
192 экранируются все символы, недопустимые |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
193 в JSON <link url="https://tools.ietf.org/html/rfc8259#section-7">строках</link>: |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
194 символы “<literal>"</literal>” и |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
195 “<literal>\</literal>” экранируются как |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
196 “<literal>\"</literal>” и “<literal>\\</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
197 символы со значениями меньше 32 экранируются как |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
198 “<literal>\n</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
199 “<literal>\r</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
200 “<literal>\t</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
201 “<literal>\b</literal>”, |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
202 “<literal>\f</literal>” или |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
203 “<literal>\u00XX</literal>”. |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
204 </para> |
b686736680e3
Documented escaping rules in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2111
diff
changeset
|
205 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
206 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
207 |
364 | 208 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
209 <directive name="open_log_file_cache"> |
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 <syntax> |
271 | 212 <literal>max</literal>=<value>N</value> |
213 [<literal>inactive</literal>=<value>время</value>] | |
214 [<literal>min_uses</literal>=<value>N</value>] | |
215 [<literal>valid</literal>=<value>время</value>]</syntax> | |
216 <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
|
217 <default>off</default> |
1776
8d0372178e00
Documented the ngx_stream_log_module module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
218 <context>stream</context> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
219 <context>server</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
220 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
221 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
222 Задаёт кэш, в котором хранятся дескрипторы файлов часто используемых |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
223 логов, имена которых заданы с использованием переменных. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
224 Параметры директивы: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
225 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
226 |
271 | 227 <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
|
228 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
229 задаёт максимальное число дескрипторов в кэше; |
507 | 230 при переполнении кэша наименее востребованные (LRU) |
224
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 |
271 | 234 <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
|
235 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
236 задаёт время, после которого закэшированный дескриптор закрывается, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 если к нему не было обращений в течение этого времени; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
238 по умолчанию 10 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
239 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
240 |
271 | 241 <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
|
242 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
243 задаёт минимальное число использований файла в течение |
271 | 244 времени, заданного параметром <literal>inactive</literal>, |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
245 после которого дескриптор файла будет оставаться открытым в кэше; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
246 по умолчанию 1 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
247 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
248 |
271 | 249 <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
|
250 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
251 задаёт, через какое время нужно проверять, что файл ещё |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
252 существует под тем же именем; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
253 по умолчанию 60 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
254 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
255 |
271 | 256 <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
|
257 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
258 запрещает кэш |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
259 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
260 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
261 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
262 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
263 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
264 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
265 Пример использования: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
266 <example> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
267 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
|
268 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
269 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
270 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
271 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
272 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
273 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
274 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
275 </module> |