Loading...
This site is best viewed in a modern browser with JavaScript enabled.
Something went wrong while trying to load the full version of this site. Try hard-refreshing this page to fix the error.
关于ngx.log的长度限制问题
yang.yang
Hi ,春哥
我发现我需要打的日志长度比较长,已经超过了ngx.log的限制,不知道是否有相关的补丁?
doujiang24
贴一个春哥以前的回答 [1]
这是标准的 nginx 核心中的限制:error log 消息有硬编码的 2048 字节的上限。这个限制主要是为了作保护,
毕竟错误日志打印是高代价操作。
你可以自己把 openresty 源码包中的 bundle/nginx-*/src/core/ngx_
log.h 文件中的下面这一行
#define NGX_MAX_ERROR_STR 2048
中的 2048 调大,然后重新用 ./configure && make && make install 构造 openresty.
我打算在下一次 ngx_openresty 发布中将此限制调大为 4096 字节,2048 确实稍微有些小。
[1]
https://groups.google.com/d/msg/openresty/_V2GYGsjxhE/WHf95wc5ZcIJ
2015-06-08 20:00 GMT+08:00 杨阳
<
yang...@upai.com
>
:
Hi ,春哥
我发现我需要打的日志长度比较长,已经超过了ngx.log的限制,不知道是否有相关的补丁?
--