Repository navigation
Log to stdout by default in Docker - #326
RealOrangeOne wants to merge 1 commit into
Conversation
This makes logs easier to view, and reduces write on the docker storage.
tchapi
left a comment
There was a problem hiding this comment.
Hi and thanks @RealOrangeOne
I don't think this works as is.
LOG_FILE_PATH=/dev/stdout would certainly fail from FPM workers. In the standalone image the master runs as root and workers as www-data, so Monolog will fail to open the pipe. We should use php://stderr our php://stdout instead I guess
PS: Diagnostics::logFile() will report DANGER because is_writable(dirname($logFilePath)) is false for a pipe like that, and docs would be stale, it would need to be adjusted.
| # By default, it will log in the standard Symfony directory: var/log/prod.log (for production) | ||
| # You can use /dev/null here if you want to discard logs entirely | ||
| # You can use /dev/null here if you want to discard logs entirely. | ||
| # Docker installations use /dev/stdout by default |
There was a problem hiding this comment.
You only modified one of the two Dockerfiles
| ENV PHP_OPCACHE_MEMORY_CONSUMPTION="256" \ | ||
| PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10" | ||
| PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10" \ | ||
| LOG_FILE_PATH="/dev/stdout" |
There was a problem hiding this comment.
The compose setup overrides the new default. docker/.env still sets LOG_FILE_PATH="%kernel.logs_dir%/%kernel.environment%.log"
| autorestart=true | ||
| redirect_stderr=true | ||
| stdout_logfile=/var/log/caddy/access.log | ||
| stdout_logfile=/dev/stdout |
There was a problem hiding this comment.
Do we really want access logs in docker logs? It's noisy ...
This makes logs easier to view, and reduces write on the docker storage.