This configuration seems normal to everyone :
[global]
error_log = /proc/self/fd/2
; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2
But this really sucks, the access log is merged with the error log.
The fpm config doesn't allow us to catch true error (error output on catch error), the fpm log info & the access log.
I can see that the the comment is true, if you try anything else that is docker supported (/dev/stdout, ...) doesn't seems to work.
But I really wonder what is the reason since other docker image works well. I really want to report the bug to the right repositories.
I've the impression that is fpm related bug but I can't find any issue reported about this.
Any help will be really appreciate.
I am not even getting this far... I am not able to get logs in the console at all.
I can see that php-fpm.d/docker.conf is being created, and this is my php.ini configuration.
However, unless I add echo "php_admin_flag[log_errors] = On">>/usr/local/etc/php-fpm.conf to my Dockerfile, I am not getting any logs.
Is there something I am overlooking?
@ssssaaa111
@gajus : try to replace
error_log = /var/log/php-errors.log by error_log = /dev/stderr and it must be working
logging to docker must be to files like /dev/stderr, /dev/stdout, /proc/self/fd/2, /proc/self/fd/1 in by capture by docker daemon
Yeah, I'd love to have a decent fix for this, but we haven't found one yet -- I'm guessing that the reason /proc/self/fd/1 (and /dev/stdout, which is a symlink to /proc/self/fd/1) doesn't work is that php-fpm likely closes STDOUT as part of its own startup routines. :disappointed:
created a bug report on php : https://bugs.php.net/bug.php?id=73886, wait and see
for information : https://github.com/php/php-src/pull/2310
It's being discussed internally with a patch available.
@tianon you have right, the patch show that the STDOUT is closed, and the patch don't close it anymore.
Hope this will be accepted :crossed_fingers:
Closing since this is a bug in upstream's handling of stdout, not something we can reasonably fix in the image.
I'd love to see a PR which adds https://bugs.php.net/bug.php?id=73886 and https://github.com/php/php-src/pull/2310 as context to our existing comment for future reference (and so we have an obvious place to go look for when this can be adjusted), though! :heart:
ala:
; if we send this to /proc/self/fd/1, it never appears
; see https://bugs.php.net/bug.php?id=73886
; and https://github.com/php/php-src/pull/2310
access.log = /proc/self/fd/2
Most helpful comment
I am not even getting this far... I am not able to get logs in the console at all.
I can see that
php-fpm.d/docker.confis being created, and this is myphp.iniconfiguration.However, unless I add
echo "php_admin_flag[log_errors] = On">>/usr/local/etc/php-fpm.confto my Dockerfile, I am not getting any logs.Is there something I am overlooking?