Bug 64978 - Error log entries from php-fpm are concatenated in Apache vhost error log
Summary: Error log entries from php-fpm are concatenated in Apache vhost error log
Status: NEW
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy_fcgi (show other bugs)
Version: 2.4.34
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-12 23:32 UTC by molecularbear
Modified: 2020-12-12 23:32 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description molecularbear 2020-12-12 23:32:19 UTC
I am using mod_proxy_fcgi to proxy requests to php-fpm 7.3.11 with a configuration very similar to this: https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM

I used the following config at the php-fpm pool level in order to get PHP errors/warnings/notices/etc to appear in the vhost's error log:

php_admin_value[error_log] =
php_admin_flag[log_errors] = on

This works, _except_ that all the PHP errors emitted by a request are concatenated within a single log entry in the vhost error log. Example:

[Sat Dec 12 17:26:22.819678 2020] [proxy_fcgi:error] [pid 15779] [client 10.223.109.206:49916] AH01071: Got error 'PHP message: PHP Notice:  TEST 123 in /www/public/test.php on line 3PHP message: PHP Notice:  TEST ABC in /www/public/test.php on line 5'

My expectation is that each PHP error would result in a _separate_ log entry, similar to how mod_php behaves. The concatenation unfortunately breaks some of my monitoring/alerting, as well as being difficult to read.

I recognize that I can log PHP errors to separate files via PHP or FPM config, but I do not want to rework my monitoring/alerting setup.

Should errors coming back over mod_proxy_fcgi not be logged in separate entries? Thank you for considering!