Configuration PHP-FPM如何抑制通知日志级别并仍然捕获警告日志/etc/PHP-FPM.conf
我很难理解如何在php fpm中抑制通知级别日志事件,例如:Configuration PHP-FPM如何抑制通知日志级别并仍然捕获警告日志/etc/PHP-FPM.conf,configuration,php,Configuration,Php,我很难理解如何在php fpm中抑制通知级别日志事件,例如: [07-Feb-2015 10:06:48] NOTICE: [pool www] child 19591 exited with code 0 after 52040.698062 seconds from start [07-Feb-2015 10:06:49] NOTICE: [pool www] child 17234 started [07-Feb-2015 10:06:50] NOTICE: [pool www] chil
[07-Feb-2015 10:06:48] NOTICE: [pool www] child 19591 exited with code 0 after 52040.698062 seconds from start
[07-Feb-2015 10:06:49] NOTICE: [pool www] child 17234 started
[07-Feb-2015 10:06:50] NOTICE: [pool www] child 19822 exited with code 0 after 52014.845635 seconds from start
[07-Feb-2015 10:06:50] NOTICE: [pool www] child 17261 started
[07-Feb-2015 10:07:33] NOTICE: [pool www] child 17784 exited with code 0 after 52246.014015 seconds from start
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: "NOTICE: PHP message: Array"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: "("
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: " [6] => 363"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: ")"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: ""
同时仍然捕获警告类型的日志事件,例如php中的error_log()函数会创建警告类型的日志事件。记录以下事件:
[07-Feb-2015 10:06:48] NOTICE: [pool www] child 19591 exited with code 0 after 52040.698062 seconds from start
[07-Feb-2015 10:06:49] NOTICE: [pool www] child 17234 started
[07-Feb-2015 10:06:50] NOTICE: [pool www] child 19822 exited with code 0 after 52014.845635 seconds from start
[07-Feb-2015 10:06:50] NOTICE: [pool www] child 17261 started
[07-Feb-2015 10:07:33] NOTICE: [pool www] child 17784 exited with code 0 after 52246.014015 seconds from start
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: "NOTICE: PHP message: Array"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: "("
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: " [6] => 363"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: ")"
[07-Feb-2015 11:46:44] WARNING: [pool www] child 32465 said into stderr: ""
在php.net中,它声明变量log_level接受以下字符串类型以调整捕获的日志级别:
错误日志级别。可能值:警报、错误、警告、通知、调试。默认值:注意
因此,在我的/etc/php-fpm.conf文件中,我自然将配置值设置为:
日志级别:警告和服务重启。然后,我没有得到上面描述的任何日志事件
我找不到任何地方的文档说明了每个日志级别选项的作用,而且似乎除了通知之外的任何内容都会抑制一切
这是在centOS机器上使用php fpm 5.4或5.5。我也有同样的问题。我通过在相应的php.ini中更改错误报告来消除通知
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
这意味着:报告除弃用、严格和通知类型以外的所有错误
日志级别似乎是错误的调整位置 我的团队和我在PHP7.0上遇到了同样的问题,PHP7.0部署在基于Ubuntu的Docker映像中。