Req #80428 [Opn->Dup]: PHP-FPM : Is there an option to suppress /ping from logs

From: Date: Mon, 07 Mar 2022 11:56:24 +0000
Subject: Req #80428 [Opn->Dup]: PHP-FPM : Is there an option to suppress /ping from logs
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-240249@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=80428&edit=1

 ID:                 80428
 Updated by:         cmb@php.net
 Reported by:        heavy-traffic-website at yopmail dot com
 Summary:            PHP-FPM : Is there an option to suppress /ping from
                     logs
-Status:             Open
+Status:             Duplicate
 Type:               Feature/Change Request
 Package:            *Configuration Issues
 Operating System:   Debian 12
 PHP Version:        8.0.14
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Closing as duplicate of <https://github.com/php/php-src/issues/8174>.


Previous Comments:
------------------------------------------------------------------------
[2022-03-06 14:30:07] heavy-traffic-website at yopmail dot com

The following patch has been added/updated:

Patch Name: php-fpm-ping_dontlog
Revision:   1646577007
URL:        https://bugs.php.net/patch-display.php?bug=80428&patch=php-fpm-ping_dontlog&revision=1646577007

------------------------------------------------------------------------
[2022-02-27 08:43:12] heavy-traffic-website at yopmail dot com

Description:
------------
I have PHP-FPM, I want generate access logs but, not /ping logs when :

ping.path = /ping

I am looking for an option to disable /ping access from the logs, because I have some haproxy
servers that ping and it produce quantity of logs i don't need.

May a new config entry could prevent it ?

suggestion ( ping.log = no ) [default]

$> tail /var/log/php8/mypool/access.log
- -  27/Nov/2020:02:12:50 +0100 "GET /ping" 200 - 0.241 2048 0.00%
- -  27/Nov/2020:02:12:54 +0100 "GET /ping" 200 - 0.197 2048 0.00%
- -  27/Nov/2020:02:12:57 +0100 "GET /ping" 200 - 0.238 2048 0.00%
- -  27/Nov/2020:02:12:58 +0100 "GET /ping" 200 - 0.309 2048 0.00%
- -  27/Nov/2020:02:13:01 +0100 "GET /ping" 200 - 0.258 2048 0.00%
- -  27/Nov/2020:02:13:04 +0100 "GET /ping" 200 - 0.190 2048 0.00%
- -  27/Nov/2020:02:13:04 +0100 "GET /ping" 200 - 0.166 2048 0.00%

------------------------------------------------------------------------
[2022-02-27 08:34:12] heavy-traffic-website at yopmail dot com

nikic@php.net > The patch has been given. Could you understand the need ?

Anybody from PHP Team can take this improvement seriously ?

We can discuss, however, this is a need from many of us, SysAdmins.

Our file logs are too bigger, useless to expanse logs for that purpose.

------------------------------------------------------------------------
[2021-02-03 10:24:55] erik dot mueller at power dot cloud

For me and I think for everyone else who is working with PHP in a container environment like Docker
this change is very important. In my specific use case I have a healthcheck set up for checking the
availability of the php-fpm endpoint in a php-fpm + nginx image. So my healthcheck looks like 

#!/bin/sh

export SCRIPT_NAME=/ping
export SCRIPT_FILENAME=/ping
export REQUEST_METHOD=GET

if ! cgi-fcgi -bind -connect localhost:9000; then
	exit 1
fi

This script gets executed every 10 seconds and so my container logs get filled up with messages like

127.0.0.1 -  03/Feb/2021:10:12:01 +0000 "GET /ping" 200

I wouldn't bother about it if I would not rely on the container logs inside my infrastructure
logging system. My logs and their size get bigger and bigger just because of a log that is actually
not relevant for me because Docker would take action if the healthcheck is failing. So having a
option to disable logging requests to the ping endpoint would be a big step ins saving space and
effort getting rid of these entries inside the logs. And I think this option would also come in
handy for many other people like DevOps (like me) and SysAdmins.

------------------------------------------------------------------------
[2020-11-28 11:50:22] heavy-traffic-website at yopmail dot com

The following patch has been added/updated:

Patch Name: php-fpm-ping_dontlog
Revision:   1606564222
URL:        https://bugs.php.net/patch-display.php?bug=80428&patch=php-fpm-ping_dontlog&revision=1606564222

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=80428


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


Thread (16 messages)

« previous php.bugs (#240249) next »