annotate xml/ru/docs/http/ngx_http_log_module.xml @ 1176:4eea26b34ea5

Documented the "if" parameter of the "access_log" directive.
author Yaroslav Zhuravlev <yar@nginx.com>
date Wed, 30 Apr 2014 19:48:40 +0400
parents a05d9fa73ce2
children aab8a1667171
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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) Igor Sysoev
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 507
diff changeset
5 Copyright (C) Nginx, Inc.
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 507
diff changeset
6 -->
be54c443235a Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents: 507
diff changeset
7
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
9
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
10 <module name="Модуль ngx_http_log_module"
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
11 link="/ru/docs/http/ngx_http_log_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
12 lang="ru"
1176
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
13 rev="12">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
14
110
40eec261c2a6 Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents: 106
diff changeset
15 <section id="summary">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
16
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
17 <para>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
18 Модуль <literal>ngx_http_log_module</literal> записывает логи запросов
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
19 в указанном формате.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
20 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
21
430
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
22 <para>
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
23 Логи записываются в контексте location’а, где заканчивается обработка.
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
24 Это может быть location, отличный от первоначального, если в процессе
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
25 обработки запроса происходит
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
26 <link doc="ngx_http_core_module.xml" id="internal">внутреннее
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
27 перенаправление</link>.
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
28 </para>
570b312367bd Documented the context of request logging.
Ruslan Ermilov <ru@nginx.com>
parents: 364
diff changeset
29
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
30 </section>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
31
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
32
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
33 <section id="example" name="Пример конфигурации">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
34
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
35 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
36 <example>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
37 log_format compression '$remote_addr - $remote_user [$time_local] '
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
38 '"$request" $status $bytes_sent '
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
39 '"$http_referer" "$http_user_agent" "$gzip_ratio"';
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
40
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
41 access_log /spool/logs/nginx-access.log compression buffer=32k;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
42 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
43 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
44
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
45 </section>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
46
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
47
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
48 <section id="directives" name="Директивы">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
49
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
50 <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
51 <syntax>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
52 <value>путь</value>
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
53 [<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
54 [<literal>buffer</literal>=<value>размер</value>
1176
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
55 [<literal>flush</literal>=<value>время</value>]]
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
56 [<literal>if</literal>=<value>условие</value>]]</syntax>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
57 <syntax>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
58 <value>путь</value>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
59 <value>формат</value>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
60 <literal>gzip[=<value>степень</value>]</literal>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
61 [<literal>buffer</literal>=<value>размер</value>]
1176
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
62 [<literal>flush</literal>=<value>время</value>]
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
63 [<literal>if</literal>=<value>условие</value>]</syntax>
1175
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
64 <syntax>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
65 <literal>syslog:</literal><literal>server</literal>=<value>адрес</value>[,<value>параметр</value>=<value>значение</value>]
1176
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
66 [<value>формат</value>
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
67 [<literal>if</literal>=<value>условие</value>]]</syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
68 <syntax><literal>off</literal></syntax>
443
1b2264bdd433 Fixed default for the access_log directive.
Ruslan Ermilov <ru@nginx.com>
parents: 430
diff changeset
69 <default>logs/access.log combined</default>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
70 <context>http</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
71 <context>server</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
72 <context>location</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
73 <context>if в location</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
74 <context>limit_except</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
75
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
76 <para>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
77 Задаёт путь, формат и настройки буферизованной записи в лог.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
78 На одном уровне может использоваться несколько логов.
1175
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
79 Запись в syslog настраивается указанием префикса
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
80 “<literal>syslog:</literal>” в первом параметре.
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
81 Специальное значение <literal>off</literal> отменяет все директивы
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
82 <literal>access_log</literal> для текущего уровня.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
83 Если формат не указан, то используется предопределённый формат
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
84 “<literal>combined</literal>”.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
85 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
86
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
87 <para>
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
88 Если задан размер буфера с помощью параметра <literal>buffer</literal> или
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
89 указан параметр <literal>gzip</literal> (1.3.10, 1.2.7), то запись будет
795
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 <note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
92 Размер буфера должен быть не больше размера атомарной записи в дисковый файл.
657
56fa3cab4ceb Completely dropped FreeBSD version information when talking about
Ruslan Ermilov <ru@nginx.com>
parents: 656
diff changeset
93 Для FreeBSD этот размер неограничен.
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
94 </note>
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
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
97 <para>
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 <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
100
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
101 <listitem>
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 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
104
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
105 <listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
106 если данные в буфере находятся дольше интервала времени, заданного
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
107 параметром <literal>flush</literal> (1.3.10, 1.2.7);
795
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
108 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
109
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
110 <listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
111 при <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
112 завершении рабочего процесса.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
113 </listitem>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
114
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
115 </list>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
116 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
117
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
118 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
119 Если задан параметр <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
120 записью в файл.
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
121 Степень сжатия может быть задана в диапазоне от 1 (быстрее, но хуже сжатие)
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
122 до 9 (медленнее, но лучше сжатие).
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 840
diff changeset
123 По умолчанию используются буфер размером 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
124 Данные сжимаются атомарными блоками, и в любой момент времени лог-файл может
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
125 быть распакован или прочитан с помощью утилиты “<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
126 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
127
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
128 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
129 Пример:
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
130 <example>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
131 access_log /path/to/log.gz combined gzip flush=5m;
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
132 </example>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
133 </para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
134
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
135 <para>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
136 <note>
41363f013cc9 Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents: 779
diff changeset
137 Для поддержки 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
138 </note>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
139 </para>
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 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
142 В пути файла можно использовать переменные (0.7.6+),
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
143 но такие логи имеют некоторые ограничения:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
144 <list type="bullet">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
145
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
146 <listitem>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
147 <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
148 с правами которого работают рабочие процессы, должен
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
149 иметь права на создание файлов в каталоге с такими логами;
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
150 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
151
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
152 <listitem>
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 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
155
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
156 <listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
157 файл открывается для каждой записи в лог и сразу же после записи закрывается.
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
158 Следует однако иметь в виду, что поскольку дескрипторы часто используемых файлов
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
159 могут храниться в <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
160 то при вращении логов в течение времени, заданного параметром
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
161 <literal>valid</literal> директивы <link id="open_log_file_cache"/>,
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 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
164
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
165 <listitem>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
166 при каждой записи в лог проверяется существование
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
167 <link doc="ngx_http_core_module.xml" id="root">корневого каталога</link>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
168 для запроса — если этот каталог не существует, то лог не создаётся.
106
56457a474903 If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents: 102
diff changeset
169 Поэтому <link doc="ngx_http_core_module.xml" id="root"/>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
170 и <literal>access_log</literal> нужно описывать на одном уровне:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
171 <example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
172 server {
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
173 root /spool/vhost/data/$host;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
174 access_log /spool/vhost/logs/$host;
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
175 ...
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
176 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
177 </listitem>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
178
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
179 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
180 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
181
1175
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
182 <para>
1176
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
183 Параметр <literal>if</literal> (1.7.0) включает условную запись в лог.
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
184 Запрос не будет записываться в лог, если результатом вычисления
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
185 <value>условия</value> является “0” или пустая строка.
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
186 В следующем примере запросы с кодами ответа 2xx и 3xx
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
187 не будут записываться в лог:
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
188 <example>
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
189 map $status $loggable {
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
190 ~^[23] 0;
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
191 default 1;
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
192 }
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
193
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
194 access_log /path/to/access.log combined if=$loggable;
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
195 </example>
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
196 </para>
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
197
4eea26b34ea5 Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1175
diff changeset
198 <para>
1175
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
199 Запись в syslog настраивается при помощи следующих параметров:
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
200 <list type="tag">
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
201
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
202 <tag-name><literal>server=</literal><value>адрес</value></tag-name>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
203 <tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
204 Задаёт адрес сервера syslog.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
205 Адрес может быть указан в виде доменного имени, IP-адреса или
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
206 в виде пути UNIX-сокета (указывается после префикса
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
207 “<literal>unix:</literal>”).
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
208 Вместе с именем или адресом может быть указан порт.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
209 Если порт не указан, используется порт 514.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
210 Если доменному имени соответствует несколько IP-адресов,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
211 используется только первый адрес.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
212 </tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
213
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
214 <tag-name><literal>facility=</literal><value>строка</value></tag-name>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
215 <tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
216 Задаёт категорию сообщений syslog в соответствии с
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
217 <link url="http://tools.ietf.org/html/rfc3164#section-4.1.1">RFC 3164</link>.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
218 В качестве категории может быть указано одно из следующих значений:
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
219 “<literal>kern</literal>”, “<literal>user</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
220 “<literal>mail</literal>”, “<literal>daemon</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
221 “<literal>auth</literal>”, “<literal>intern</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
222 “<literal>lpr</literal>”, “<literal>news</literal>”, “<literal>uucp</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
223 “<literal>clock</literal>”, “<literal>authpriv</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
224 “<literal>ftp</literal>”, “<literal>ntp</literal>”, “<literal>audit</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
225 “<literal>alert</literal>”, “<literal>cron</literal>”,
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
226 “<literal>local0</literal>”..“<literal>local7</literal>”.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
227 По умолчанию используется “<literal>local7</literal>”.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
228 </tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
229
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
230 <tag-name><literal>severity=</literal><value>строка</value></tag-name>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
231 <tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
232 Задаёт важность сообщений syslog в соответствии с
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
233 <link url="http://tools.ietf.org/html/rfc3164#section-4.1.1">RFC 3164</link>.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
234 Возможны те же самые значения, что и у второго параметра (уровень)
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
235 директивы <link doc="../ngx_core_module.xml" id="error_log"/>.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
236 По умолчанию используется “<literal>info</literal>”.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
237 </tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
238
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
239 <tag-name><literal>tag=</literal><value>строка</value></tag-name>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
240 <tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
241 Задаёт метку сообщений syslog.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
242 По умолчанию используется “<literal>nginx</literal>”.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
243 </tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
244
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
245 <!--
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
246 <tag-name><literal>bare=</literal><literal>on</literal> |
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
247 <literal>off</literal></tag-name>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
248 <tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
249 Если включено, сообщения отправляются без заголовка syslog.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
250 По умолчанию выключено.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
251 </tag-desc>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
252 -->
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
253
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
254 </list>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
255 Пример конфигурации syslog:
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
256 <example>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
257 access_log syslog:server=192.168.1.1;
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
258 access_log syslog:server=unix:/var/log/nginx.sock;
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
259 access_log syslog:server=[2001:db8::1]:12345,facility=local7,tag=nginx,severity=info combined;
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
260 </example>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
261 </para>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
262
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
263 <para>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
264 <note>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
265 Запись в syslog доступна как часть
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
266 <commercial_version>коммерческой подписки</commercial_version>.
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
267 </note>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
268 </para>
a05d9fa73ce2 Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1155
diff changeset
269
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
270 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
271
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 <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
274 <syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
275 <value>название</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
276 <value>строка</value> ...</syntax>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
277 <default>combined "..."</default>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
278 <context>http</context>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
279
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
280 <para>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
281 Задаёт формат лога.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
282 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
283
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
284 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
285 Кроме общих переменных в формате можно использовать переменные,
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
286 существующие только на момент записи в лог:
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
287 <list type="tag">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
288
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
289 <tag-name id="var_bytes_sent"><var>$bytes_sent</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
290 <tag-desc>
769
d71e56d56ada Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents: 657
diff changeset
291 число байт, переданное клиенту
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
292 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
293
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
294 <tag-name id="var_connection"><var>$connection</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
295 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
296 порядковый номер соединения
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
297 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
298
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
299 <tag-name id="var_connection_requests"><var>$connection_requests</var>
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
300 </tag-name>
452
e9a2a856d76b Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents: 451
diff changeset
301 <tag-desc>
769
d71e56d56ada Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents: 657
diff changeset
302 текущее число запросов в соединении (1.1.18)
452
e9a2a856d76b Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents: 451
diff changeset
303 </tag-desc>
e9a2a856d76b Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents: 451
diff changeset
304
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
305 <tag-name id="var_msec"><var>$msec</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
306 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
307 время в секундах с точностью до миллисекунд на момент записи в лог
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
308 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
309
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
310 <tag-name id="var_pipe"><var>$pipe</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
311 <tag-desc>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
312 “<literal>p</literal>” если запрос был pipelined, иначе “<literal>.</literal>”
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
313 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
314
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
315 <tag-name id="var_request_length"><var>$request_length</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
316 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
317 длина запроса (включая строку запроса, заголовок и тело запроса)
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
318 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
319
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
320 <tag-name id="var_request_time"><var>$request_time</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
321 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
322 время обработки запроса в секундах с точностью до миллисекунд;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
323 время, прошедшее с момента чтения первых байт от клиента до
451
6351ab788157 Documented $request_time more precisely.
Ruslan Ermilov <ru@nginx.com>
parents: 443
diff changeset
324 момента записи в лог после отправки последних байт клиенту
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
325 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
326
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
327 <tag-name id="var_status"><var>$status</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
328 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
329 статус ответа
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
330 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
331
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
332 <tag-name id="var_time_iso8601"><var>$time_iso8601</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
333 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
334 локальное время в формате по стандарту ISO 8601
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
335 </tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
336
1155
07402a11fd8d Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents: 966
diff changeset
337 <tag-name id="var_time_local"><var>$time_local</var></tag-name>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
338 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
339 локальное время в Common Log Format
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
340 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
341
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
342 </list>
826
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
343
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
344 <note>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
345 В современных версиях nginx переменные
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
346 <link doc="ngx_http_core_module.xml" id="var_status">$status</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
347 (1.3.2, 1.2.2),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
348 <link doc="ngx_http_core_module.xml" id="var_bytes_sent">$bytes_sent</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
349 (1.3.8, 1.2.5),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
350 <link doc="ngx_http_core_module.xml" id="var_connection">$connection</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
351 (1.3.8, 1.2.5),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
352 <link doc="ngx_http_core_module.xml" id="var_connection_requests">$connection_requests</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
353 (1.3.8, 1.2.5),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
354 <link doc="ngx_http_core_module.xml" id="var_msec">$msec</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
355 (1.3.9, 1.2.6),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
356 <link doc="ngx_http_core_module.xml" id="var_request_time">$request_time</link>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
357 (1.3.9, 1.2.6),
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
358 <link doc="ngx_http_core_module.xml" id="var_pipe">$pipe</link>
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
359 (1.3.12, 1.2.7),
826
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
360 <link doc="ngx_http_core_module.xml" id="var_request_length">$request_length</link>
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
361 (1.3.12, 1.2.7),
826
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
362 <link doc="ngx_http_core_module.xml" id="var_time_iso8601">$time_iso8601</link>
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
363 (1.3.12, 1.2.7)
826
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
364 и
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
365 <link doc="ngx_http_core_module.xml" id="var_time_local">$time_local</link>
840
9dab69f2b71d Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents: 826
diff changeset
366 (1.3.12, 1.2.7)
826
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
367 также доступны как общие переменные.
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
368 </note>
ddd22f571529 Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents: 795
diff changeset
369
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
370 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
371
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
372 <para>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
373 Строки заголовка, переданные клиенту, начинаются с префикса
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
374 “<literal>sent_http_</literal>”, например,
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
375 <var>$sent_http_content_range</var>.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
376 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
377
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
378 <para>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
379 В конфигурации всегда существует предопределённый формат
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
380 “<literal>combined</literal>”:
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
381 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 274
diff changeset
382 log_format combined '$remote_addr - $remote_user [$time_local] '
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 274
diff changeset
383 '"$request" $status $body_bytes_sent '
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 274
diff changeset
384 '"$http_referer" "$http_user_agent"';
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
385 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
386 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
387
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
388 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
389
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
390
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
391 <directive name="open_log_file_cache">
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
392
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
393 <syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
394 <literal>max</literal>=<value>N</value>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
395 [<literal>inactive</literal>=<value>время</value>]
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
396 [<literal>min_uses</literal>=<value>N</value>]
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
397 [<literal>valid</literal>=<value>время</value>]</syntax>
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
398 <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
399 <default>off</default>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
400 <context>http</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
401 <context>server</context>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
402 <context>location</context>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
403
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
404 <para>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
405 Задаёт кэш, в котором хранятся дескрипторы файлов часто используемых
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
406 логов, имена которых заданы с использованием переменных.
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
407 Параметры директивы:
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
408 <list type="tag">
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
409
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
410 <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
411 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
412 задаёт максимальное число дескрипторов в кэше;
507
d00a4f9b1c5d Better translation of "LRU".
Ruslan Ermilov <ru@nginx.com>
parents: 452
diff changeset
413 при переполнении кэша наименее востребованные (LRU)
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
414 дескрипторы закрываются
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
415 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
416
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
417 <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
418 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
419 задаёт время, после которого закэшированный дескриптор закрывается,
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
420 если к нему не было обращений в течение этого времени;
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
421 по умолчанию 10 секунд
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
422 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
423
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
424 <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
425 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
426 задаёт минимальное число использований файла в течение
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
427 времени, заданного параметром <literal>inactive</literal>,
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
428 после которого дескриптор файла будет оставаться открытым в кэше;
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
429 по умолчанию 1
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
430 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
431
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
432 <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
433 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
434 задаёт, через какое время нужно проверять, что файл ещё
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
435 существует под тем же именем;
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
436 по умолчанию 60 секунд
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
437 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
438
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
439 <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
440 <tag-desc>
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
441 запрещает кэш
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
442 </tag-desc>
76
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
443
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
444 </list>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
445 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
446
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
447 <para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
448 Пример использования:
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
449 <example>
224
7f36795d99a2 Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents: 222
diff changeset
450 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
451 </example>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
452 </para>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
453
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
454 </directive>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
455
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
456 </section>
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
457
4a4caa566120 Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff changeset
458 </module>