I try to run a Yii based PHP application in a Docker container using the official php-fpm image.
It's common practice for docker containers to write all log messages to stdout
/ stderr
. So I do the same from my container with a code that basically looks like this:
$fp = @fopen('php://stdout','w');
fwrite($fp, $message);
fclose($fp);
Unfortunately PHP-FPM now prefixes all my log messages with ugly warnings:
[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" ...
Why is this and is there a way to prevent PHP-FPM from doing this?
UPDATE:
- I've also opened an issue at the docker-library/php project site.
- They already include the
catch_workers_output = yes
in their configuration. So that's not the solution. - According to these changes the problem should be fixed in PHP 7.3