Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_log_module.xml @ 1097:eeb690d4212b
Documented the PROXY protocol support.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 18 Mar 2014 19:59:24 +0400 |
parents | 95c3c3bbf1ce |
children | 07402a11fd8d |
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" |
840
9dab69f2b71d
Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents:
826
diff
changeset
|
13 rev="9"> |
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> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
55 [<literal>flush</literal>=<value>время</value>]]]</syntax> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
56 <syntax> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
57 <value>путь</value> |
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 <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
|
60 [<literal>buffer</literal>=<value>размер</value>] |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
61 [<literal>flush</literal>=<value>время</value>]</syntax> |
271 | 62 <syntax><literal>off</literal></syntax> |
443
1b2264bdd433
Fixed default for the access_log directive.
Ruslan Ermilov <ru@nginx.com>
parents:
430
diff
changeset
|
63 <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
|
64 <context>http</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
65 <context>server</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
66 <context>location</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
67 <context>if в location</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
68 <context>limit_except</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
69 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
70 <para> |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
71 Задаёт путь, формат и настройки буферизованной записи в лог. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
72 На одном уровне может использоваться несколько логов. |
271 | 73 Специальное значение <literal>off</literal> отменяет все директивы |
74 <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
|
75 Если формат не указан, то используется предопределённый формат |
271 | 76 “<literal>combined</literal>”. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
77 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
78 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
79 <para> |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
80 Если задан размер буфера с помощью параметра <literal>buffer</literal> или |
840
9dab69f2b71d
Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents:
826
diff
changeset
|
81 указан параметр <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
|
82 буферизованной. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
83 <note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 Размер буфера должен быть не больше размера атомарной записи в дисковый файл. |
657
56fa3cab4ceb
Completely dropped FreeBSD version information when talking about
Ruslan Ermilov <ru@nginx.com>
parents:
656
diff
changeset
|
85 Для FreeBSD этот размер неограничен. |
795
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
86 </note> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
87 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
88 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
89 <para> |
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 <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
|
92 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
93 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
94 если очередная строка лога не помещается в буфер; |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
95 </listitem> |
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 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
98 если данные в буфере находятся дольше интервала времени, заданного |
840
9dab69f2b71d
Documented nginx 1.2.7 changes.
Ruslan Ermilov <ru@nginx.com>
parents:
826
diff
changeset
|
99 параметром <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
|
100 </listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
101 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
102 <listitem> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
103 при <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
|
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 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
107 </list> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
108 </para> |
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 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
111 Если задан параметр <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
|
112 записью в файл. |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
113 Степень сжатия может быть задана в диапазоне от 1 (быстрее, но хуже сжатие) |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
114 до 9 (медленнее, но лучше сжатие). |
966 | 115 По умолчанию используются буфер размером 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
|
116 Данные сжимаются атомарными блоками, и в любой момент времени лог-файл может |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
117 быть распакован или прочитан с помощью утилиты “<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
|
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 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
120 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
121 Пример: |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
122 <example> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
123 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
|
124 </example> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
125 </para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
126 |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
127 <para> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
128 <note> |
41363f013cc9
Documented the recently added "gzip" and "flush" parameters of the "access_log"
Valentin Bartenev <vbart@nginx.com>
parents:
779
diff
changeset
|
129 Для поддержки 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
|
130 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
131 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
132 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
133 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
134 В пути файла можно использовать переменные (0.7.6+), |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
135 но такие логи имеют некоторые ограничения: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
136 <list type="bullet"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
137 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
138 <listitem> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
139 <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
|
140 с правами которого работают рабочие процессы, должен |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
141 иметь права на создание файлов в каталоге с такими логами; |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
142 </listitem> |
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 <listitem> |
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> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
147 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
148 <listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
149 файл открывается для каждой записи в лог и сразу же после записи закрывается. |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
150 Следует однако иметь в виду, что поскольку дескрипторы часто используемых файлов |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
151 могут храниться в <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
|
152 то при вращении логов в течение времени, заданного параметром |
271 | 153 <literal>valid</literal> директивы <link id="open_log_file_cache"/>, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
154 запись может продолжаться в старый файл. |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
155 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
156 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
157 <listitem> |
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 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
|
160 для запроса — если этот каталог не существует, то лог не создаётся. |
106
56457a474903
If text of the link is not provided, the @id is used.
Ruslan Ermilov <ru@nginx.com>
parents:
102
diff
changeset
|
161 Поэтому <link doc="ngx_http_core_module.xml" id="root"/> |
271 | 162 и <literal>access_log</literal> нужно описывать на одном уровне: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
163 <example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
164 server { |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
165 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
|
166 access_log /spool/vhost/logs/$host; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
167 ... |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
168 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
169 </listitem> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
170 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
171 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
172 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
173 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
174 </directive> |
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 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
177 <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
|
178 <syntax> |
271 | 179 <value>название</value> |
180 <value>строка</value> ...</syntax> | |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
181 <default>combined "..."</default> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
182 <context>http</context> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
183 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
184 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
185 Задаёт формат лога. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
186 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
187 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
188 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
189 Кроме общих переменных в формате можно использовать переменные, |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
190 существующие только на момент записи в лог: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
191 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
192 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
193 <tag-name><var>$bytes_sent</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
194 <tag-desc> |
769
d71e56d56ada
Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents:
657
diff
changeset
|
195 число байт, переданное клиенту |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
196 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
197 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
198 <tag-name><var>$connection</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
199 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
200 порядковый номер соединения |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
201 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
202 |
452
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
203 <tag-name><var>$connection_requests</var></tag-name> |
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
204 <tag-desc> |
769
d71e56d56ada
Documented variables relocations between http log and core modules.
Vladimir Homutov <vl@nginx.com>
parents:
657
diff
changeset
|
205 текущее число запросов в соединении (1.1.18) |
452
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
206 </tag-desc> |
e9a2a856d76b
Documented the $connection_requests variable.
Ruslan Ermilov <ru@nginx.com>
parents:
451
diff
changeset
|
207 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
208 <tag-name><var>$msec</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
209 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
210 время в секундах с точностью до миллисекунд на момент записи в лог |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
211 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
212 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
213 <tag-name><var>$pipe</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
214 <tag-desc> |
271 | 215 “<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
|
216 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
217 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
218 <tag-name><var>$request_length</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
219 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
220 длина запроса (включая строку запроса, заголовок и тело запроса) |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
221 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
222 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
223 <tag-name><var>$request_time</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
224 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
225 время обработки запроса в секундах с точностью до миллисекунд; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
226 время, прошедшее с момента чтения первых байт от клиента до |
451
6351ab788157
Documented $request_time more precisely.
Ruslan Ermilov <ru@nginx.com>
parents:
443
diff
changeset
|
227 момента записи в лог после отправки последних байт клиенту |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
228 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
229 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
230 <tag-name><var>$status</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
231 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
232 статус ответа |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
233 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
234 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
235 <tag-name><var>$time_iso8601</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
236 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
237 локальное время в формате по стандарту ISO 8601 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
238 </tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
239 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
240 <tag-name><var>$time_local</var></tag-name> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
241 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
242 локальное время в Common Log Format |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
243 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
244 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
245 </list> |
826
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
246 |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
247 <note> |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
248 В современных версиях nginx переменные |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
249 <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
|
250 (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
|
251 <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
|
252 (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
|
253 <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
|
254 (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
|
255 <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
|
256 (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
|
257 <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
|
258 (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
|
259 <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
|
260 (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
|
261 <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
|
262 (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
|
263 <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
|
264 (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
|
265 <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
|
266 (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
|
267 и |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
268 <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
|
269 (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
|
270 также доступны как общие переменные. |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
271 </note> |
ddd22f571529
Variables $pipe, $request_length, $time_iso8601, and $time_local.
Ruslan Ermilov <ru@nginx.com>
parents:
795
diff
changeset
|
272 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
273 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
274 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
275 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
276 Строки заголовка, переданные клиенту, начинаются с префикса |
271 | 277 “<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
|
278 <var>$sent_http_content_range</var>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
279 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
280 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
281 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
282 В конфигурации всегда существует предопределённый формат |
271 | 283 “<literal>combined</literal>”: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
284 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
274
diff
changeset
|
285 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
|
286 '"$request" $status $body_bytes_sent ' |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
274
diff
changeset
|
287 '"$http_referer" "$http_user_agent"'; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
288 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
289 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
290 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
291 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
292 |
364 | 293 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
294 <directive name="open_log_file_cache"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
295 |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
296 <syntax> |
271 | 297 <literal>max</literal>=<value>N</value> |
298 [<literal>inactive</literal>=<value>время</value>] | |
299 [<literal>min_uses</literal>=<value>N</value>] | |
300 [<literal>valid</literal>=<value>время</value>]</syntax> | |
301 <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
|
302 <default>off</default> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
303 <context>http</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
304 <context>server</context> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
305 <context>location</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
306 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
307 <para> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
308 Задаёт кэш, в котором хранятся дескрипторы файлов часто используемых |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
309 логов, имена которых заданы с использованием переменных. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
310 Параметры директивы: |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
311 <list type="tag"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
312 |
271 | 313 <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
|
314 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
315 задаёт максимальное число дескрипторов в кэше; |
507 | 316 при переполнении кэша наименее востребованные (LRU) |
224
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 |
271 | 320 <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
|
321 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
322 задаёт время, после которого закэшированный дескриптор закрывается, |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
323 если к нему не было обращений в течение этого времени; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
324 по умолчанию 10 секунд |
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 |
271 | 327 <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
|
328 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
329 задаёт минимальное число использований файла в течение |
271 | 330 времени, заданного параметром <literal>inactive</literal>, |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
331 после которого дескриптор файла будет оставаться открытым в кэше; |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
332 по умолчанию 1 |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
333 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
334 |
271 | 335 <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
|
336 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
337 задаёт, через какое время нужно проверять, что файл ещё |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
338 существует под тем же именем; |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
339 по умолчанию 60 секунд |
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 |
271 | 342 <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
|
343 <tag-desc> |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
344 запрещает кэш |
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
345 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
346 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
347 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
348 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
349 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
350 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
351 Пример использования: |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
352 <example> |
224
7f36795d99a2
Updated ngx_http_log_module documentation including translation into English.
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
353 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
|
354 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
355 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
356 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
357 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
358 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
359 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
360 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
361 </module> |