It’s common practice for docker containers to write all log messages to
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?
- I’ve also opened an issue at the docker-library/php project site.
- They already include the
catch_workers_output = yesin their configuration. So that’s not the solution.
- According to these changes the problem should be fixed in PHP 7.3
It is correct. you are running php-fpm and error logs are from php-fpm , not from PHP .
you should expect php-fpm log , not php log. fortunately php-fpm will write every log that received from PHP in end of its logs.