php.net |  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
Votes:42
Avg. Score:4.5 ± 0.7
Reproduced:42 of 42 (100.0%)
Same Version:18 (42.9%)
Same OS:32 (76.2%)
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
Description:
------------
On Dockerfile, the official distribution of php have this configuration : 

[global]
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 : https://github.com/docker-library/php/issues/358#issuecomment-271033464

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***


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-10 19:06 UTC] bukka@php.net
-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] bukka@php.net
-Type: Bug +Type: Feature/Change Request
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 06:01:30 2024 UTC