Mercurial > hg > nginx-site
annotate xml/ru/docs/debugging_log.xml @ 1697:147e3d0339e8
Reduced syntax clutter in the error_log directive.
The description text explains special values like "stderr", "syslog:...",
and "memory:...". It is believed that syntax without explicitly listing
these variants is more readable.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 10 May 2016 15:19:47 +0300 |
parents | 64ed0ce8ac5e |
children | 0108c6525d2a |
rev | line source |
---|---|
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
516
diff
changeset
|
1 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
516
diff
changeset
|
2 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
516
diff
changeset
|
3 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
516
diff
changeset
|
4 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
516
diff
changeset
|
5 |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
6 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
7 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <article name="Отладочный лог" |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 link="/ru/docs/debugging_log.html" |
589 | 10 lang="ru" |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
11 rev="4"> |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
12 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
13 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 <section> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 <para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 Чтобы включить отладочный лог, при сборке следует сконфигурировать nginx с |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 поддержкой отладки: |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
19 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
20 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
21 ./configure --with-debug ... |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
22 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
23 |
271 | 24 Затем нужно задать уровень <literal>debug</literal> с помощью |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 директивы <link doc="ngx_core_module.xml" id="error_log"/>: |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 Бинарная версия nginx для Windows всегда собирается с поддержкой отладочного |
271 | 32 лога, поэтому понадобится лишь задать уровень <literal>debug</literal>. |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 <para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 Обратите внимание, что переопределение лога без одновременного указания |
271 | 37 уровня <literal>debug</literal> отключит отладочный лог. |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 В примере ниже, переопределение лога на уровне |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 <link doc="http/ngx_http_core_module.xml" id="server"/> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 отключает отладочный лог для этого сервера: |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 http { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 server { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 error_log /path/to/log; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 ... |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 Чтобы избежать этого, следует либо закомментировать строку, переопределяющую |
271 | 50 лог, либо добавить определение уровня <literal>debug</literal>: |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 http { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
55 server { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 ... |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
58 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 |
1448
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
61 </section> |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
62 |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
63 |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
64 <section id="clients" name="Отладочный лог для определённых клиентов"> |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
65 |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 <para> |
516
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
67 Можно включить отладочный лог только для |
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
68 <link doc="ngx_core_module.xml" id="debug_connection">определённых |
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
69 клиентских адресов</link>: |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 error_log /path/to/log; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 events { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 debug_connection 192.168.1.1; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 debug_connection 192.168.10.0/24; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 } |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 </section> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
83 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
84 <section id="memory" name="Запись в кольцевой буфер в памяти"> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
85 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
86 <para> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
87 Отладочный лог можно записывать в кольцевой буфер в памяти: |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
88 <programlisting> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
89 error_log memory:32m debug; |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
90 </programlisting> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
91 Запись в буфер в памяти на уровне <literal>debug</literal> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
92 не оказывает существенного влияния на производительность |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
93 даже при высоких нагрузках. |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
94 В этом случае лог может быть извлечён при помощи |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
95 <command>gdb</command>-скрипта, подобного следующему: |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
96 <example> |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
97 set $log = ngx_cycle->log |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
98 |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
99 while $log->writer != ngx_log_memory_writer |
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
100 set $log = $log->next |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
101 end |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
102 |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
103 set $buf = (ngx_log_memory_buf_t *) $log->wdata |
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
104 dump binary memory debug_log.txt $buf->start $buf->end |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
105 </example> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
106 </para> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
107 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
108 </section> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
109 |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
110 </article> |