|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #73886 Handle access log & error log on Docker
Submitted: 2017-01-07 08:23 UTC Modified: 2021-12-02 22:51 UTC
Avg. Score:4.5 ± 0.7
Reproduced:43 of 43 (100.0%)
Same Version:18 (41.9%)
Same OS:33 (76.7%)
From: tchiot dot ludo at gmail dot com Assigned: bukka (profile)
Status: Assigned Package: FPM related
PHP Version: 7.1.0 OS: Docker
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-01-07 08:23 UTC] tchiot dot ludo at gmail dot com
On Dockerfile, the official distribution of php have this configuration : 

error_log = /proc/self/fd/2 

; if we send this to /proc/self/fd/1, it never appears
access.log = /proc/self/fd/2

seems related to this configuration : 

catch_workers_output boolean
Redirect worker stdout and stderr into main error log. If not set, stdout and stderr will be redirected to /dev/null according to FastCGI specs. Default value: no.

With this configuration, we can't really parse log file (or monitor log) because access log & php fpm stdout & error log in not separated.

see dockerfile maintainer response :

So there is 2 issues here : 
- access log won't write to docker special files : /dev/stdout
- fpm main log with catch_workers_output = yes output stdout & stderr on the same log file, maybe we need a new configuration options in order to have workers output error to stderr & fpm master process std*** to std***


Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 19:06 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: bukka
 [2019-08-08 11:36 UTC] yudkin146 at gmail dot com
Faced with same problem.
Can not write to "/dev/stderr" or even "/proc/self/fd/2" from php-fpm, but can do it from "php -r" or bash or anything else.

file_put_contents(/proc/self/fd/2): failed to open stream: No such file or directory

I use docker image php:7-fpm with full standard config.
 [2021-12-02 22:51 UTC]
-Type: Bug +Type: Feature/Change Request
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 11:01:29 2024 UTC