Req #69509 [Com]: fpm slowlog file permissions feature

From: Date: Wed, 19 May 2021 16:58:44 +0000
Subject: Req #69509 [Com]: fpm slowlog file permissions feature
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-233901@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69509&edit=1

 ID:                 69509
 Comment by:         donnav dot ex at boozt dot com
 Reported by:        chenmingjie0828 at 163 dot com
 Summary:            fpm slowlog file permissions feature
 Status:             Open
 Type:               Feature/Change Request
 Package:            FPM related
 Operating System:   Centos6
 PHP Version:        5.6.8
 Block user comment: N
 Private report:     N

 New Comment:

Patch has been created since 2015 (6 years ago), what's stops this to release it? It make sense
to have an option to choose file mode and especially a default to 0644 on log.


Previous Comments:
------------------------------------------------------------------------
[2016-11-07 09:23:19] pim at lemonbit dot com

Please make the file permissions on the slow log the same as the error log (same as process owner
and group).

------------------------------------------------------------------------
[2015-07-02 16:54:11] mgarrido at archipelia dot com

This feature is very helpful.
I want to push php-fpm logs to my logstash.
But, my logstash daemon isn't root.
So, he can't read php-fpm logs.
With can't chmod manually because logrotate reset rights after his execution.

------------------------------------------------------------------------
[2015-04-23 06:29:28] chenmingjie0828 at 163 dot com

Description:
------------
php-fpm generate log files with a default permission 0600,which makes other user or group unable to
read the slow log or access log. So I make a patch to fixed this problem , which allows users to
configure the file permission as they wanted. The entry in fpm configuration is file_mode directive.

fpm configruation:
slowlog = log/$pool.log.slow
request_slowlog_timeout = 5
request_terminate_timeout = 10

New feature:
   file_mode = 0644 //or other file permission u want.



Test script:
---------------
<?php
sleep(10);
echo "hello world";
?>


Expected result:
----------------
I expect fpm generate a slow log with file permission that other people are able to read.

Actual result:
--------------
ls -la www-slow_log 
-rw------- 1 root root 0 Apr 23 02:03 www.log.slow 

Actually, It generate a slow log with file permission 0666(-rw- --- ---),which makes other
people unable to read. It's quite inconvenient, since I want some other development people to
read it. 


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



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


Thread (4 messages)

« previous php.bugs (#233901) next »