comparison xml/cn/docs/debugging_log.xml @ 558:149f54c158f0

Added initial translation in simplified Chinese submitted by the Server Platforms Team at Taobao.com.
author Ruslan Ermilov <ru@nginx.com>
date Thu, 28 Jun 2012 10:27:07 +0000
parents
children 9934338f83af
comparison
equal deleted inserted replaced
557:654096219aba 558:149f54c158f0
1 <!DOCTYPE article SYSTEM "../../../dtd/article.dtd">
2
3 <article name="调试日志"
4 link="/cn/docs/debugging_log.html"
5 lang="cn">
6
7
8 <section>
9
10 <para>
11 要开启调试日志,首先需要在配置nginx时打开调试功能,然后编译:
12
13 <programlisting>
14 ./configure --with-debug ...
15 </programlisting>
16
17 然后在配置文件中设置<literal>error_log</literal>的级别为<literal>debug</literal>:
18
19 <programlisting>
20 error_log /path/to/log debug;
21 </programlisting>
22
23 nginx的windows二进制版本总是将调试日志开启的,因此只需要设置<literal>debug</literal>的日志级别即可。
24 </para>
25
26 <para>
27 注意,在其他级别定义日志,如在<i>server</i>层次,会关闭该主机的日志:
28 <programlisting>
29 error_log /path/to/log debug;
30
31 http {
32 server {
33 error_log /path/to/log;
34 ...
35 </programlisting>
36 应该注释掉这条server日志,或者也增加<literal>debug</literal>标志:
37 <programlisting>
38 error_log /path/to/log debug;
39
40 http {
41 server {
42 error_log /path/to/log debug;
43 ...
44 </programlisting>
45 </para>
46
47 <para>
48 另外,也可以只针对某些地址开启调试日志:
49
50 <programlisting>
51 error_log /path/to/log;
52
53 events {
54 debug_connection 192.168.1.1;
55 debug_connection 192.168.10.0/24;
56 }
57 </programlisting>
58 </para>
59
60 </section>
61
62 </article>