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:
catch_workers_output = yes
in their configuration. So that's not the solution.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With