Mercurial > hg > nginx-site
annotate xml/ru/docs/debugging_log.xml @ 2846:fdf1464e1977
Moved banner to the external file to make partial rollout possible.
An idea is to have several banners and show them with different probability
specified by split directive in the nginx.conf
author | Sergey Budnevitch <sb@waeme.net> |
---|---|
date | Tue, 10 May 2022 18:07:27 +0400 |
parents | 0108c6525d2a |
children | b274d289798d |
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" |
1701
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
11 rev="5"> |
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> |
1701
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
17 Для работы отладочного лога nginx должен быть сконфигурирован с поддержкой |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
18 отладки на этапе сборки: |
214
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 |
1701
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
31 Чтобы убедиться, что поддержка отладки сконфигурирована, |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
32 необходимо выполнить команду <command>nginx -V</command>: |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
33 |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
34 <programlisting> |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
35 configure arguments: --with-debug ... |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
36 </programlisting> |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
37 |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
38 Готовые пакеты для <link doc="../linux_packages.xml">Linux</link> |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
39 по умолчанию предоставляют поддержку отладочного лога |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
40 при помощи бинарного файла <literal>nginx-debug</literal> (1.9.8), |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
41 который можно запустить при помощи команд |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
42 |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
43 <programlisting> |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
44 service nginx stop |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
45 service nginx-debug start |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
46 </programlisting> |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
47 |
0108c6525d2a
Added info about linux packages to "Debugging log".
Fedor Dikarev <fe@nginx.com>
parents:
1479
diff
changeset
|
48 и затем задать уровень <literal>debug</literal>. |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 Бинарная версия nginx для Windows всегда собирается с поддержкой отладочного |
271 | 50 лога, поэтому понадобится лишь задать уровень <literal>debug</literal>. |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
51 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
52 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
53 <para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
54 Обратите внимание, что переопределение лога без одновременного указания |
271 | 55 уровня <literal>debug</literal> отключит отладочный лог. |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
56 В примере ниже, переопределение лога на уровне |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
57 <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
|
58 отключает отладочный лог для этого сервера: |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
59 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
60 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
61 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
62 http { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
63 server { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
64 error_log /path/to/log; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
65 ... |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
66 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
67 Чтобы избежать этого, следует либо закомментировать строку, переопределяющую |
271 | 68 лог, либо добавить определение уровня <literal>debug</literal>: |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
69 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
70 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
71 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
72 http { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
73 server { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
74 error_log /path/to/log debug; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
75 ... |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
76 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
77 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
78 |
1448
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
79 </section> |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
80 |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
81 |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
82 <section id="clients" name="Отладочный лог для определённых клиентов"> |
d3390895fe6e
Added subchapter in the "Debugging log" article.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
589
diff
changeset
|
83 |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 <para> |
516
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
85 Можно включить отладочный лог только для |
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
86 <link doc="ngx_core_module.xml" id="debug_connection">определённых |
8e1356bd281a
Documented the "debug_connection" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
87 клиентских адресов</link>: |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
88 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
89 <programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
90 error_log /path/to/log; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
91 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
92 events { |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
93 debug_connection 192.168.1.1; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
94 debug_connection 192.168.10.0/24; |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
95 } |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
96 </programlisting> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
97 </para> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
98 |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
99 </section> |
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
100 |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
101 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
102 <section id="memory" name="Запись в кольцевой буфер в памяти"> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
103 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
104 <para> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
105 Отладочный лог можно записывать в кольцевой буфер в памяти: |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
106 <programlisting> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
107 error_log memory:32m debug; |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
108 </programlisting> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
109 Запись в буфер в памяти на уровне <literal>debug</literal> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
110 не оказывает существенного влияния на производительность |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
111 даже при высоких нагрузках. |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
112 В этом случае лог может быть извлечён при помощи |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
113 <command>gdb</command>-скрипта, подобного следующему: |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
114 <example> |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
115 set $log = ngx_cycle->log |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
116 |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
117 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
|
118 set $log = $log->next |
1449
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
119 end |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
120 |
1479
64ed0ce8ac5e
Fixed the gdb script for dumping in-memory debug log.
Valentin Bartenev <vbart@nginx.com>
parents:
1449
diff
changeset
|
121 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
|
122 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
|
123 </example> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
124 </para> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
125 |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
126 </section> |
c79501e16e26
Documented cyclic memory buffer support for error_log.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1448
diff
changeset
|
127 |
214
c99c8df86eb9
Translated the "Debugging Log" article into Russian.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
128 </article> |