Req #71880 [Opn]: Optionally disable warnings when writing to STDOUT

From: Date: Fri, 26 Aug 2016 07:57:48 +0000
Subject: Req #71880 [Opn]: Optionally disable warnings when writing to STDOUT
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203559@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71880&edit=1

 ID:                 71880
 User updated by:    haertl dot mike at gmail dot com
 Reported by:        haertl dot mike at gmail dot com
 Summary:            Optionally disable warnings when writing to STDOUT
 Status:             Open
 Type:               Feature/Change Request
 Package:            FPM related
 Operating System:   Linux
 PHP Version:        5.6.19
 Block user comment: N
 Private report:     N

 New Comment:

> I meant the tailing solution with a log file instead a named pipe.

Because then you have to override the CMD in your Dockerfile. So whenever the CMD in the underlying
official base image changes you must make sure, that you change your line accordingly. This is error
prone as it's easy to miss this step whenever you upgrade to a newer version.


Previous Comments:
------------------------------------------------------------------------
[2016-08-26 07:49:08] mark dot sagikazar at gmail dot com

> Logging to a file is not an alternative. You also don't want to lose your logfiles when a
> container is recreated.

I think you misunderstood me. I meant the tailing solution with a log file instead a named pipe.

------------------------------------------------------------------------
[2016-08-26 07:28:36] haertl dot mike at gmail dot com

> What's the advantage of using a named pipe instead of a file? The log file should be lost
> with the restart of the container anyway.

Because that's how logging is handled in the docker world. There are many tools that you can
use to dynamically route your logs to different targets, e.g. logspout. PHP-FPM can't be used
in this way due to the issue above.

Logging to a file is not an alternative. You also don't want to lose your logfiles when a
container is recreated.

------------------------------------------------------------------------
[2016-08-25 16:42:46] mark dot sagikazar at gmail dot com

What's the advantage of using a named pipe instead of a file? The log file should be lost with
the restart of the container anyway.

------------------------------------------------------------------------
[2016-07-06 11:01:30] inefedor at gmail dot com

Just as a quick solution without the need for grepping/sedding you could use named pipes:

mkfifo /tmp/stdout

In docker CMD you'd write something along the lines of

CMD service start && tail -f /tmp/stdout

And in PHP you would need to write to /tmp/stdout, this way you won't have to use file system
to store the output.

------------------------------------------------------------------------
[2016-07-06 09:28:49] copong at gmail dot com

Definitely an issue when running fpm on containers, only way we've found around this that
doesn't involve tailing a log file is to pipe fpm's output through sed, which is hacky.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=71880


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


Thread (16 messages)

« previous php.bugs (#203559) next »