php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73886 Handle access log & error log on Docker
Submitted: 2017-01-07 08:23 UTC Modified: 2017-04-10 19:06 UTC
Votes:23
Avg. Score:4.7 ± 0.6
Reproduced:23 of 23 (100.0%)
Same Version:12 (52.2%)
Same OS:16 (69.6%)
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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
22 - 20 = ?
Subscribe to this entry?

 
 [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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Sep 20 04:01:26 2019 UTC