Mercurial > hg > nginx-site
comparison xml/en/docs/debugging_log.xml @ 1449:c79501e16e26
Documented cyclic memory buffer support for error_log.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Wed, 08 Apr 2015 13:56:52 +0300 |
parents | d3390895fe6e |
children | 64ed0ce8ac5e |
comparison
equal
deleted
inserted
replaced
1448:d3390895fe6e | 1449:c79501e16e26 |
---|---|
6 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> | 6 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd"> |
7 | 7 |
8 <article name="A debugging log" | 8 <article name="A debugging log" |
9 link="/en/docs/debugging_log.html" | 9 link="/en/docs/debugging_log.html" |
10 lang="en" | 10 lang="en" |
11 rev="2"> | 11 rev="3"> |
12 | 12 |
13 | 13 |
14 <section> | 14 <section> |
15 | 15 |
16 <para> | 16 <para> |
80 </programlisting> | 80 </programlisting> |
81 </para> | 81 </para> |
82 | 82 |
83 </section> | 83 </section> |
84 | 84 |
85 | |
86 <section id="memory" name="Logging to a cyclic memory buffer"> | |
87 | |
88 <para> | |
89 The debugging log can be written to a cyclic memory buffer: | |
90 <programlisting> | |
91 error_log memory:32m debug; | |
92 </programlisting> | |
93 Logging to the memory buffer on the <literal>debug</literal> level | |
94 does not have significant impact on performance even under high load. | |
95 In this case, the log can be extracted using | |
96 a <command>gdb</command> script like the following one: | |
97 <example> | |
98 set $log = ngx_cycle->new_log | |
99 | |
100 while $log.writer != ngx_log_memory_writer | |
101 set $log = $log.next | |
102 end | |
103 | |
104 set $buf = (ngx_buf_t *) $log.wdata | |
105 dump binary memory log.txt $buf->start $buf->end | |
106 </example> | |
107 </para> | |
108 | |
109 </section> | |
110 | |
85 </article> | 111 </article> |