nginx.org的A debugging log页面翻译
2016-09-29 10:21
417 查看
英文文档对应页面:A debugging log
启用调试日志(debugging log),在安装时,nginx需要配置,以支持调试:
./configure --with-debug
之后,在 “error_log” 指令中,应该设置 “debug级别”(debug level)
error_log /path/to/log debug;
验证nginx是否已经配置了,支持调试(support debugging),运行 “nginx -V” 命令,会显示:
configure arguments: --with-debug
预构建(pre-build)的linux的文件包,提供了二进制可执行文件 “nginx-debug” 命令(1.9.8),以外部调用的方式(out-of-the-box)支持调试日志:
service nginx stop
service nginx-debug start
之后,设置 “debug级别” 。windows下的nginx二进制文件版本,总是支持 “调试日志”,因此,只需要设置 “debug级别” 即可
注意:重新定义 “error_log” 指令,但未指定 “debug级别”,将禁用 “调试日志”。例如下面的例子,在 “server”块 中重新定义了log,未指定 “debug级别”:error_log /path/to/log debug;
http {
server {
error_log /path/to/log; // 未指定 debug level
}
}
为了避免这种情况,重定义时,必须指定 “debug级别”
error_log memory:32m debug;
在 “debug级别” 记录日志到内存缓冲区,即使在高负载时,也不会对性能有大的影响。因此,可以使用一个 “gdb脚本”(gdb script)来从内存中获取日志??,例如:
启用调试日志(debugging log),在安装时,nginx需要配置,以支持调试:
./configure --with-debug
之后,在 “error_log” 指令中,应该设置 “debug级别”(debug level)
error_log /path/to/log debug;
验证nginx是否已经配置了,支持调试(support debugging),运行 “nginx -V” 命令,会显示:
configure arguments: --with-debug
预构建(pre-build)的linux的文件包,提供了二进制可执行文件 “nginx-debug” 命令(1.9.8),以外部调用的方式(out-of-the-box)支持调试日志:
service nginx stop
service nginx-debug start
之后,设置 “debug级别” 。windows下的nginx二进制文件版本,总是支持 “调试日志”,因此,只需要设置 “debug级别” 即可
注意:重新定义 “error_log” 指令,但未指定 “debug级别”,将禁用 “调试日志”。例如下面的例子,在 “server”块 中重新定义了log,未指定 “debug级别”:error_log /path/to/log debug;
http {
server {
error_log /path/to/log; // 未指定 debug level
}
}
为了避免这种情况,重定义时,必须指定 “debug级别”
error_log /path/to/log debug; http { server { error_log /path/to/log debug; // 必须指定 debug level } }
为指定的客户端,开启调试日志
为指定的客户端,开启调试日志也是可以的,使用如下配置:error_log /path/to/log; events { debug_connection 192.168.1.1; debug_connection 192.168.10.0/24; }
记录日志到一个循环的内存缓冲区
调试日志也可以写入到一个循环的内存缓存区(a cyclic memory buffer)error_log memory:32m debug;
在 “debug级别” 记录日志到内存缓冲区,即使在高负载时,也不会对性能有大的影响。因此,可以使用一个 “gdb脚本”(gdb script)来从内存中获取日志??,例如:
set $log = ngx_cycle->log while $log->writer != ngx_log_memory_writer set $log = $log->next end set $buf = (ngx_log_memory_buf_t *) $log->wdata dump binary memory debug_log.txt $buf->start $buf->end
相关文章推荐
- nginx.org的about页面翻译
- nginx.org的Configuring HTTPS servers页面翻译
- nginx.org的Logging to syslog页面翻译
- nginx.org的Using nginx as HTTP load balancer页面翻译
- nginx.org的Configuration file measurement units页面翻译
- nginx.org的beginner's guide页面翻译
- nginx.org的Server names页面翻译
- nginx.org的Command-line parameters页面翻译
- nginx.org的How nginx processes a request页面翻译
- nginx.org的How nginx processes a TCP/UDP session页面翻译
- nginx的controlling nginx页面翻译
- nginx的Setting up hashes页面翻译
- nginx的Connection processing methods页面翻译
- Nginx--官网中文翻译(中英文对比)--5-调试日志A debugging log
- 页面生命周期 ---Scott Mitchell ---翻译:yocan
- 利用Google把你的页面翻译成英文(一个学习英文或有此功能需要的进)
- JSP页面翻译原理
- [翻译]ASP.NET Web页面是如何在Web服务器端产生的
- [翻译]自定义Sharepoint的登陆页面
- ASP.NET极限:页面导航 (翻译)