Bug #76229 [Opn->Csd]: wrong rsyslog parameters from php-fpm logs
Edit report at https://bugs.php.net/bug.php?id=76229&edit=1
ID: 76229
Updated by: bukka@php.net
Reported by: aguytech at free dot fr
Summary: wrong rsyslog parameters from php-fpm logs
-Status: Open
+Status: Closed
Type: Bug
Package: FPM related
Operating System: debian9 stretch
PHP Version: 7.0.29
-Assigned To:
+Assigned To: bukka
Block user comment: N
Private report: N
New Comment:
> error_log=syslog error_log=syslog error in syslog: wrong systaglog
This should be fixed in 7.3 that has got an option to set facility and ident in PHP ini. You just
need to make sure that they match the ones in php-fpm conf.
The other cases are expected. If you don't want error in apache log, then you need to disable
fastcgi.logging ini.
Previous Comments:
------------------------------------------------------------------------
[2018-04-18 11:06:08] aguytech at free dot fr
Just changed the bug type...
------------------------------------------------------------------------
[2018-04-18 11:02:29] aguytech at free dot fr
I think I have found the origin of problem : error_log in php.ini
test & results :
php.ini php-fpm.conf result
error_log=syslog ;error_log error in syslog
+ not error in apache log
error_log=syslog error_log=/file error in syslog
+ not error in apache log
error_log=syslog error_log=syslog error in syslog: wrong systaglog
not error in apache log
error_log=/file error_log=syslog error in syslog: good systaglog
error in apache log
;error_log error_log=syslog error in syslog: good systaglog
error in apache log
------------------------------------------------------------------------
[2018-04-17 12:03:20] aguytech at free dot fr
Description:
------------
I catch wrong rsyslog parameters in fpm-php logs
here is wrong rsyslog parameters :
syslogtag=ool
programname=ool
app-name=ool
procid=
Test script:
---------------
Debian9 stretch
PHP 7.0.27-0+deb9u1 (cli) (built: Jan 5 2018 13:51:52) ( NTS )
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
rsyslogd 8.24.0,
"php-fpm.conf":
error_log = syslog
syslog.facility = daemon
syslog.ident = php7.0-fpm
log_level = notice
"test.php":
<?php
trigger_error("E_USER_WARNING", E_USER_WARNING);
rsyslog template:
template(name="ALL" type="string" string="%timegenerated%
-HOSTNAME=%HOSTNAME% -syslogtag=%syslogtag% -programname=%programname%
-syslogfacility=%syslogfacility% -syslogfacility-text=%syslogfacility-text%
-syslogseverity=%syslogseverity% -syslogseverity-text=%syslogseverity-text%
-syslogpriority=%syslogpriority% -syslogpriority-text=%syslogpriority-text% -inputname=%inputname%
-app-name=%app-name% -procid=%procid% -msgid=%msgid% -fromhost=%fromhost% -fromhost-ip=%fromhost-ip%
%msg%\n")
Expected result:
----------------
it should be better to have 'www-test[6681]' prepending message for the syslogtag
parameters :
syslogtag=www-test[6681]
programname=www-test
app-name=www-test
procid=6681
At least 'pool' or 'Pool' in place of 'ool' to filter messages in
syslog.
Actual result:
--------------
php-fpm log:
Apr 17 13:13:52 -HOSTNAME=debian9-php -syslogtag=ool -programname=ool -syslogfacility=3
-syslogfacility-text=daemon -syslogseverity=5 -syslogseverity-text=notice -syslogpriority=5
-syslogpriority-text=notice -inputname=imuxsock -app-name=ool -procid=- -msgid=-
-fromhost=debian9-php -fromhost-ip=127.0.0.1 www-test[6681]: PHP Warning: E_USER_WARNING in
/var/www/localhost/public_html/test.php on line 2
syslogtag=ool
programname=ool
app-name=ool
procid=
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76229&edit=1
Thread (4 messages)