我尝试使用
official php-fpm映像在Docker容器中运行
Yii based PHP application。
Docker容器通常会将所有日志消息写入stdout / stderr。所以我从我的容器做同样的代码,基本上看起来像这样:
$fp = @fopen('php://stdout','w');
fwrite($fp, $message);
fclose($fp);
不幸的是,PHP-FPM现在为我的所有日志消息添加了丑陋的警告:
[21-Mar-2016 14:10:02] WARNING: [pool www] child 12 said into stdout: “2016-03-21 14:10:02 [x.x.x.x][-][-][trace][yii\base\Application::bootstrap] Bootstrap with yii\debug\Module::bootstrap()”
[21-Mar-2016 14:10:02] WARNING: [pool www] child 12 said into stdout: “2016-03-21 14:10:02 [x.x.x.x][-][-][info][yii\web\Session::open] Session started”
…
为什么这样,有没有办法防止PHP-FPM这样做?
更新:
>我还在docker-library/php项目现场开了an issue。
>他们已经在their configuration中包含了catch_workers_output = yes。所以这不是解决方案。