Bug #74469 [Com]: syslog.ident setting ignored when logging errors (error_log=syslog)

From: Date: Tue, 18 Apr 2017 16:49:37 +0000
Subject: Bug #74469 [Com]: syslog.ident setting ignored when logging errors (error_log=syslog)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208640@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74469&edit=1

 ID:                 74469
 Comment by:         vedad at kajtaz dot net
 Reported by:        vedad at kajtaz dot net
 Summary:            syslog.ident setting ignored when logging errors
                     (error_log=syslog)
 Status:             Open
 Type:               Bug
 Package:            FPM related
 Operating System:   FreeBSD 10.3
 PHP Version:        7.1.4
 Block user comment: N
 Private report:     N

 New Comment:

I was actually wrong - the explicit syslog() call also sends the (hardcoded?) "php-fpm"
ident to syslog.

Only administrative logs seem to hold the correct ident, eg:

2017-04-18T18:47:21.608127+02:00 ps foobar[2553]: [NOTICE] configuration file XXXX test is
successful
2017-04-18T18:47:21.645774+02:00 ps foobar[2555]: [NOTICE] fpm is running, pid 2555
2017-04-18T18:47:21.702506+02:00 ps foobar[2555]: [NOTICE] ready to handle connections


Previous Comments:
------------------------------------------------------------------------
[2017-04-18 16:42:44] vedad at kajtaz dot net

Description:
------------
The FPM setting 'syslog.ident' is ignored when PHP errors (eg. syntax errors) are being
logged to syslog (error_log = syslog).

Instead of the specified syslog.ident, "php-fpm" is always being sent to
syslog, while the explicit syslog() calls (not preceeded by an explicit openlog()) from scripts
correctly use the configured syslog.ident.

Occurs both on latest 7.0 and 7.1 releases.

Test script:
---------------
Set the following FPM setting:

error_log = syslog
syslog.ident = foobar

Start/reload FPM, invoke a script containing a syntax error.

Expected result:
----------------
2017-04-18T18:29:00.080031+02:00 ps foobar[XXX]: PHP Parse error:  syntax error, unexpected
'return' (T_RETURN) in ... on line ...


Actual result:
--------------
2017-04-18T18:29:00.080031+02:00 ps php-fpm[XXX]: PHP Parse error:  syntax error, unexpected
'return' (T_RETURN) in ... on line ...



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=74469&edit=1


Thread (3 messages)

« previous php.bugs (#208640) next »