Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_log_module.xml @ 2178:cb431c861670
Added njs examples.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 05 Jun 2018 18:23:50 +0300 |
parents | 64004f50b9dd |
children | b686736680e3 |
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 | 12 lang="ru" |
2161
64004f50b9dd
Clarified the log_format "escape=none" description.
Sergey Kandaurov <pluknet@nginx.com>
parents:
2111
diff
changeset
|
13 rev="19"> |
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 | 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 | 52 <value>путь</value> |
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>] |
1694
080b36ad8d76
Reduced syntax clutter in the access_log directive.
Maxim Dounin <mdounin@mdounin.ru>
parents:
1285
diff
changeset
|
55 [<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
|
56 [<literal>flush</literal>=<value>время</value>] |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
57 [<literal>if</literal>=<value>условие</value>]]</syntax> |
271 | 58 <syntax><literal>off</literal></syntax> |
443
1b2264bdd433
Fixed default for the access_log directive.
Ruslan Ermilov <ru@nginx.com>
parents:
430
diff
changeset
|
59 <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
|
60 <context>http</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
61 <context>server</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
62 <context>location</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
63 <context>if в location</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
64 <context>limit_except</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
65 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
66 <para> |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
67 Задаёт путь, формат и настройки буферизованной записи в лог. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
68 На одном уровне может использоваться несколько логов. |
1285
4e89518a5999
Moved syslog configuration details into the separate documents.
Ruslan Ermilov <ru@nginx.com>
parents:
1205
diff
changeset
|
69 Запись в <link doc="../syslog.xml">syslog</link> |
4e89518a5999
Moved syslog configuration details into the separate documents.
Ruslan Ermilov <ru@nginx.com>
parents:
1205
diff
changeset
|
70 настраивается указанием префикса |
1175
a05d9fa73ce2
Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1155
diff
changeset
|
71 “<literal>syslog:</literal>” в первом параметре. |
271 | 72 Специальное значение <literal>off</literal> отменяет все директивы |
73 <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
|
74 Если формат не указан, то используется предопределённый формат |
271 | 75 “<literal>combined</literal>”. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
76 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 <para> |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
79 Если задан размер буфера с помощью параметра <literal>buffer</literal> или |
840
9dab69f2b71d
Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents:
826
diff
changeset
|
80 указан параметр <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
|
81 буферизованной. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
82 <note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 Размер буфера должен быть не больше размера атомарной записи в дисковый файл. |
657
56fa3cab4ceb
Completely dropped FreeBSD version information when talking about
Ruslan Ermilov <ru@nginx.com>
parents:
656
diff
changeset
|
84 Для FreeBSD этот размер неограничен. |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
85 </note> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
86 </para> |
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 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
89 При включённой буферизации данные записываются в файл: |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
90 <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
|
91 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
92 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
93 если очередная строка лога не помещается в буфер; |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
94 </listitem> |
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 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
97 если данные в буфере находятся дольше интервала времени, заданного |
840
9dab69f2b71d
Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents:
826
diff
changeset
|
98 параметром <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
|
99 </listitem> |
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 при <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
|
103 завершении рабочего процесса. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
104 </listitem> |
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 </list> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
107 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
108 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
109 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
110 Если задан параметр <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
|
111 записью в файл. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
112 Степень сжатия может быть задана в диапазоне от 1 (быстрее, но хуже сжатие) |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
113 до 9 (медленнее, но лучше сжатие). |
966 | 114 По умолчанию используются буфер размером 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
|
115 Данные сжимаются атомарными блоками, и в любой момент времени лог-файл может |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
116 быть распакован или прочитан с помощью утилиты “<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
|
117 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
118 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
119 <para> |
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 <example> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
122 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
|
123 </example> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
124 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
125 |
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 <note> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
128 Для поддержки 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
|
129 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
130 </para> |
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 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 В пути файла можно использовать переменные (0.7.6+), |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 но такие логи имеют некоторые ограничения: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 <list type="bullet"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 <listitem> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
138 <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
|
139 с правами которого работают рабочие процессы, должен |
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 <listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
144 не работает буферизация; |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
145 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
146 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 <listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 файл открывается для каждой записи в лог и сразу же после записи закрывается. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
149 Следует однако иметь в виду, что поскольку дескрипторы часто используемых файлов |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
150 могут храниться в <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
|
151 то при вращении логов в течение времени, заданного параметром |
271 | 152 <literal>valid</literal> директивы <link id="open_log_file_cache"/>, |
76
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> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
157 при каждой записи в лог проверяется существование |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
158 <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
|
159 для запроса — если этот каталог не существует, то лог не создаётся. |
106
56457a474903
If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents:
102
diff
changeset
|
160 Поэтому <link doc="ngx_http_core_module.xml" id="root"/> |
271 | 161 и <literal>access_log</literal> нужно описывать на одном уровне: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
162 <example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
163 server { |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
164 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
|
165 access_log /spool/vhost/logs/$host; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
166 ... |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
167 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
168 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
169 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
170 </list> |
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 |
1175
a05d9fa73ce2
Documented the syslog support in "error_log" and "access_log".
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1155
diff
changeset
|
173 <para> |
1176
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
174 Параметр <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
|
175 Запрос не будет записываться в лог, если результатом вычисления |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
176 <value>условия</value> является “0” или пустая строка. |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
177 В следующем примере запросы с кодами ответа 2xx и 3xx |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
178 не будут записываться в лог: |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
179 <example> |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
180 map $status $loggable { |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
181 ~^[23] 0; |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
182 default 1; |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
183 } |
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 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
|
186 </example> |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
187 </para> |
4eea26b34ea5
Documented the "if" parameter of the "access_log" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1175
diff
changeset
|
188 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
189 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
190 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
191 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
192 <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
|
193 <syntax> |
271 | 194 <value>название</value> |
2111
dab82d534f0f
Documented the "none" escape mode of the "log_format" directive.
Vladimir Homutov <vl@nginx.com>
parents:
1884
diff
changeset
|
195 [<literal>escape</literal>=<literal>default</literal>|<literal>json</literal>|<literal>none</literal>] |
271 | 196 <value>строка</value> ...</syntax> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
197 <default>combined "..."</default> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
198 <context>http</context> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
199 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
200 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
201 Задаёт формат лога. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
202 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
203 |
1874
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
204 <para id="log_format_escape"> |
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
205 Параметр <literal>escape</literal> (1.11.8) позволяет задать |
1884
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
206 экранирование символов <literal>json</literal> или <literal>default</literal> |
0b339643b08f
Changed <value> to <literal> in log_fomrat.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1874
diff
changeset
|
207 в переменных, по умолчанию используется <literal>default</literal>. |
2161
64004f50b9dd
Clarified the log_format "escape=none" description.
Sergey Kandaurov <pluknet@nginx.com>
parents:
2111
diff
changeset
|
208 Значение <literal>none</literal> (1.13.10) отключает |
2111
dab82d534f0f
Documented the "none" escape mode of the "log_format" directive.
Vladimir Homutov <vl@nginx.com>
parents:
1884
diff
changeset
|
209 экранирование символов. |
1874
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
210 </para> |
33f742032155
Documented support for json escaping in log_format.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1694
diff
changeset
|
211 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
212 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
213 Кроме общих переменных в формате можно использовать переменные, |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
214 существующие только на момент записи в лог: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
215 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
216 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
217 <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
|
218 <tag-desc> |
769
d71e56d56ada
Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents:
657
diff
changeset
|
219 число байт, переданное клиенту |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
220 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
221 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
222 <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
|
223 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
224 порядковый номер соединения |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
225 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
226 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
227 <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
|
228 </tag-name> |
452
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
229 <tag-desc> |
769
d71e56d56ada
Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents:
657
diff
changeset
|
230 текущее число запросов в соединении (1.1.18) |
452
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
231 </tag-desc> |
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
232 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
233 <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
|
234 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
235 время в секундах с точностью до миллисекунд на момент записи в лог |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
236 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
238 <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
|
239 <tag-desc> |
271 | 240 “<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
|
241 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
242 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
243 <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
|
244 <tag-desc> |
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 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
247 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
248 <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
|
249 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
250 время обработки запроса в секундах с точностью до миллисекунд; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
251 время, прошедшее с момента чтения первых байт от клиента до |
451
6351ab788157
Documented $request_time more precisely.
Ruslan Ermilov <ru@nginx.com>
parents:
443
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 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
254 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
255 <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
|
256 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
257 статус ответа |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
258 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
259 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
260 <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
|
261 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
262 локальное время в формате по стандарту ISO 8601 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
263 </tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
264 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
265 <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
|
266 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
267 локальное время в Common Log Format |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
268 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
269 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
270 </list> |
826
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
271 |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
272 <note> |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
273 В современных версиях nginx переменные |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
274 <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
|
275 (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
|
276 <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
|
277 (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
|
278 <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
|
279 (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
|
280 <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
|
281 (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
|
282 <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
|
283 (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
|
284 <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
|
285 (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
|
286 <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
|
287 (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
|
288 <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
|
289 (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
|
290 <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
|
291 (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
|
292 и |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
293 <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
|
294 (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
|
295 также доступны как общие переменные. |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
296 </note> |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
297 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
298 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
299 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
300 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
301 Строки заголовка, переданные клиенту, начинаются с префикса |
271 | 302 “<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
|
303 <var>$sent_http_content_range</var>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
304 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
305 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
306 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
307 В конфигурации всегда существует предопределённый формат |
271 | 308 “<literal>combined</literal>”: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
309 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
274
diff
changeset
|
310 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
|
311 '"$request" $status $body_bytes_sent ' |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
274
diff
changeset
|
312 '"$http_referer" "$http_user_agent"'; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
313 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
314 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
315 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
316 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
317 |
364 | 318 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
319 <directive name="open_log_file_cache"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
320 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
321 <syntax> |
271 | 322 <literal>max</literal>=<value>N</value> |
323 [<literal>inactive</literal>=<value>время</value>] | |
324 [<literal>min_uses</literal>=<value>N</value>] | |
325 [<literal>valid</literal>=<value>время</value>]</syntax> | |
326 <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
|
327 <default>off</default> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
328 <context>http</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
329 <context>server</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
330 <context>location</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
331 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
332 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
333 Задаёт кэш, в котором хранятся дескрипторы файлов часто используемых |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
334 логов, имена которых заданы с использованием переменных. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
335 Параметры директивы: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
336 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
337 |
271 | 338 <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
|
339 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
340 задаёт максимальное число дескрипторов в кэше; |
507 | 341 при переполнении кэша наименее востребованные (LRU) |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
342 дескрипторы закрываются |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
343 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
344 |
271 | 345 <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
|
346 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
347 задаёт время, после которого закэшированный дескриптор закрывается, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
348 если к нему не было обращений в течение этого времени; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
349 по умолчанию 10 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
350 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
351 |
271 | 352 <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
|
353 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
354 задаёт минимальное число использований файла в течение |
271 | 355 времени, заданного параметром <literal>inactive</literal>, |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
356 после которого дескриптор файла будет оставаться открытым в кэше; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
357 по умолчанию 1 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
358 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
359 |
271 | 360 <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
|
361 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
362 задаёт, через какое время нужно проверять, что файл ещё |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
363 существует под тем же именем; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
364 по умолчанию 60 секунд |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
365 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
366 |
271 | 367 <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
|
368 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
369 запрещает кэш |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
370 </tag-desc> |
76
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 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
373 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
374 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
375 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
376 Пример использования: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
377 <example> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
378 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
|
379 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
380 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
381 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
382 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
383 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
384 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
385 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
386 </module> |