|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-04-17 12:03 UTC] 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=
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 10:00:01 2025 UTC |
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