probably a pretty simple question but how do I change the log format for FPM logs? An Entry looks like this for im in stderr:
2017/12/12 10:59:09 [error] 17#17: *6 FastCGI sent in stderr: "PHP message: 2017-12-12 11:59:09 > WARNING > WarningId: 1234 []
The thing I want to remove is the [error] part because in this example I'm logging a warning via monolog.
A complete debug log for PHP-FPM errors can be found in the /opt/bitnami/php/var/log directory.
The configuration file is /etc/php- fpm. conf.
Look for the entry Configuration File (php. Find the Error handling and logging section of the php. ini file. Make sure that both display_errors = On, display_startup_errors = On and log_errors = On are present and uncommented. Check the value of error_log - this tells you the location of the file errors are logged to.
Enable Error Logging in php. To log errors in PHP, open the php. ini file and uncomment/add the following lines of code. If you want to enable PHP error logging in individual files, add this code at the top of the PHP file. ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL);
Since PHP 7.3 you can use
[www]
catch_workers_output = yes
decorate_workers_output = no
in php-fpm.conf (or php-fpm.d/ or pool.d/, depends on your system) to remove some extra decoration
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