https://github.com/jimdelois/behance-docker-php-stdout-bug
https://github.com/jimdelois/behance-docker-php-stdout-bug
Last synced: 19 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/jimdelois/behance-docker-php-stdout-bug
- Owner: jimdelois
- Created: 2020-11-19T06:45:40.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-19T06:48:07.000Z (over 4 years ago)
- Last Synced: 2025-02-17T09:45:10.831Z (4 months ago)
- Language: PHP
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
To reproduce:
```bash
git clone [email protected]:jimdelois/behance-docker-php-stdout-bug
cd behance-docker-php-stdout-bug
docker-compose up -d
```
Enter the Docker Machine Name for your local
```bash
DOCKER_MACHINE_NAME=""
```
Send a request to the container:
```bash
curl -XGET http://$(docker-machine ip $DOCKER_MACHINE_NAME):$(docker port badboy 8080 | awk '{split($0,a,":"); print a[2]}')
```Examine the Docker logging by examining the raw container logs from the docker host
(e.g., `docker-machine ssh $DOCKER_MACHINE_NAME`, thence `tail -F /var/lib/docker/containers/$CONTAINER_ID/$CONTAINER_ID-json.log`):
- Actual: `{"log":"I want a Bad Boy Sandwich\n","stream":"stderr","time":"2020-11-19T06:18:08.672226893Z"}`
- Expected: `{"log":"I want a Bad Boy Sandwich\n","stream":"stdout","time":"2020-11-19T06:18:08.672226893Z"}`Notes:
- Raw PHP stream explicitly set to `php://stdout`; Loggers (e.g., Monolog) in production applications typically use this stream
- The unexpected outcome is that containers are sending "normal" PHP output to STDERR, which affects metrics in AWS, FluentD routing, Sumo queries, etc.