|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69509 fpm slowlog file permissions feature
Submitted: 2015-04-23 06:29 UTC Modified: -
Avg. Score:4.3 ± 0.7
Reproduced:11 of 12 (91.7%)
Same Version:1 (9.1%)
Same OS:4 (36.4%)
From: chenmingjie0828 at 163 dot com Assigned:
Status: Open Package: FPM related
PHP Version: 5.6.8 OS: Centos6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: chenmingjie0828 at 163 dot com
New email:
PHP Version: OS:


 [2015-04-23 06:29 UTC] chenmingjie0828 at 163 dot com
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:
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. 


filemode.patch (last revision 2015-04-23 06:29 UTC by chenmingjie0828 at 163 dot com)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-02 16:54 UTC] 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.
 [2016-11-07 09:23 UTC] 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).
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sun Oct 25 22:01:24 2020 UTC