-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
PHP error_log configuration is missing #662
Comments
I was doing some research around this and I'm seeing conflicting information. I see issues saying this needs to be added in order for docker to get error logs, but also some issues (admittedly old ones) are saying this won't work for php-fpm because of child process log mixing. It would be helpful to get some more information so I don't waste time looking at outdated info. Is something not working that making this change would fix? Do you have any other background on why it should be added other than the upstream image has it? |
This is the most extensive guide that I have found related to this topic: https://rtfm.co.ua/en/linux-php-fpm-docker-stdout-and-stderr-no-an-applications-error-logs/ This comment is also fairly detailed about related configuration bits: docker-library/php#878 (comment)
Maybe you have read this in GH issues or in the Stackoverflow post but it looks like all problems have been solved around these with PHP 8.0 (with My ultimate goal with this change is to see fatal errors at least in container logs on Kibana when the application crashes and not even Monolog was booted that could have distributed log messages to Logtash or other places. And for the record, what triggered this change request is that Monolog failed to send a log to Logstash due to some networking issues therefore it got tracked nowhere... So even if Monolog is working, other issues (like I/O, and networking) could happen but we cannot lose logs. So my idea is using setting up |
In addition, Symfony's logging doc also says:
https://symfony.com/doc/current/logging.html#where-logs-are-stored |
I had some time to look into this some more. It looks to me that everything is already configured correctly? When I test our images with php code that throws errors, everything is getting logged correctly for a docker architecture. I also checkout our upstream images and it's already being set as you suggested https://github.com/docker-library/php/blob/9e9fd53ae5107ce1904e9bb6b428b93b9519037c/8.2/alpine3.16/fpm/Dockerfile#L230. Are there specific error that you aren't seeing in the logs? Can you provide a reproducible test? |
@mxr576 do you have any more info on this? I'll close it as not reproducible if not. |
We think this is working as expected. |
error_log
configuration is not set in PHP images. It should be set to/proc/self/fd/2
like in the official PHP image.This is basically the default configuration for 12fa PHP application.
The text was updated successfully, but these errors were encountered: