php.ini 中的 log_errors_max_len = 1024,但 php 日志一直在增长

2022-01-04 00:00:00 permissions php logfiles maxlength

正如标题所说,我已经为 php 错误日志设置了最大长度,但它似乎一直增长得比 1024 大得多.我正在使用正确的 php.ini,我已经重新启动了 apache 等.php日志的权限是666.

As the title says, I've set the max length for the php error log, but it seems to keep growing much much larger than 1024. I am using the correct php.ini, I've restarted apache, etc. The permissions on the php log are 666.

推荐答案

作为 PHP 的典型,从配置设置的名称,甚至 文档,但该指令适用于单个日志的长度消息,而不是整个日志文件的长度.

As is typical for PHP, it is not really obvious from the name of the configuration setting, or even the documentation, but this directive applies to the length of a single log message, not the length of the log file as a whole.

使用 logrotate 或类似工具来完成您要执行的操作.

Use logrotate or a similar tool for what you are trying to do.

相关文章