PHP Nginx error_log被截断 [英] PHP Nginx error_log getting truncated

查看:56
本文介绍了PHP Nginx error_log被截断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行nginx和PHP 5.5,当传递的字符串很长时,我的所有 error_log 消息都会被截断.

I'm running nginx and PHP 5.5 and all my error_log messages are getting truncated when the string that's passed is long.

我已经更新了我的 php.ini 文件,并将日志的最大长度从1024增加到0(无最大值),并且这种情况仍在发生.

I've updated my php.ini file and increased the log max length from 1024 to 0 (no maximum) and it's still happening.

推荐答案

如果您希望日志行长于2048字节,则需要重新编译Nginx.来自 http://wiki.nginx.org/HttpLuaModule :

You need to recompile Nginx if you want log lines longer than 2048 bytes. From http://wiki.nginx.org/HttpLuaModule:

Nginx核心中的错误消息有硬编码的长度限制.最多为2048个字节,包括结尾的换行符和前导的时间戳.您可以通过修改Nginx源树中src/core/ngx_log.h文件中的NGX_MAX_ERROR_STR宏定义来手动修改此限制.如果消息大小超出此限制,则Nginx核心将自动截断消息文本.

There is a hard-coded length limitation on the error messages in the Nginx core. It is 2048 bytes at most, including the trailing newlines and the leading timestamps. You can manually modify this limit by modifying the NGX_MAX_ERROR_STR macro definition in the src/core/ngx_log.h file in the Nginx source tree. If the message size exceeds this limit, the Nginx core will truncate the message text automatically.

这篇关于PHP Nginx error_log被截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆