Reputation: 109
Debug logs not coming when updating Symfony from v2.8 to v6.4 with PHP8 upgrade.
We have updated our application from Symfony v2.8 to v6.4 along with upgrade of PHP from v7.4 to v8.1. We have used the new framework and put all our code with relevant changes and we have been able to bring the application up. But we are facing issues with the Debug log. We have our application hosted in RedHat Openshift where we send our logs to stdout/stderr instead of files to be visible under the logs in the openshift pods.
Symfony v2.8 had the below setting in the config.yml to use the Monolog:
monolog:
channels: ['mm']
handlers:
main:
type: stream
path: "php://stdout"
level: info
formatter: mm_logger.formatter
mm:
type: stream
path: "php://stdout"
level: debug
channels: mm
formatter: mm_logger.formatter
The same setting has changed in Symfony v6.4 to monolog.yaml within the config/packages folder. The monolog details are added in the bundles.php within config folder as " Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true] ". But in the symfony v6.4 the logs are not coming in the pods.
Please not that when I change to rotating files in the local, the logs are coming fine with proper format but when changing to "php://stdout" in the server, they are not coming.
The version are Symfony v6.4, PHP v8.1, Monolog v3.7.0
With the change in the php version also could be issues but not sure what else need to be change to see the logs in the Pods, may be some php-fpm path or anything else I am missing ?
Is there any change in setting in Symfony v6 or PHP8 that could cause the issue, or some configuration changes needed ? Any help is really approciated.
I have tried changing the setting and expecting the debug logs to come in Openshift Pods.
Upvotes: 0
Views: 68
Reputation: 109
The issue was resolve by altering the 2 values in the php-fpm setting as mentioned below:
catch_workers_output = yes
decorate_workers_output = no
Thanks to the below 2 post :
After updating the above settings in "php-fpm.c/www.conf" file, we were able to get the debug logs.
Upvotes: 0