Fix gunicorn logging in docker#390
Conversation
15d07bf to
09fd295
Compare
|
is there a way to set gunicorn to log to both a file and dockers logs? |
|
|
||
| # this syntax satisfies the type checker | ||
| is_docker = SystemEnv.get_bool("AUGUR_DOCKER_DEPLOY", False) | ||
| is_docker = SystemEnv.get_bool("COLLECTOSS_DOCKER_DEPLOY", False) |
There was a problem hiding this comment.
This is a change that was made in another PR already. can you rebase your PR on top of current main?
There was a problem hiding this comment.
Can you explain why this was put in its own file/made into a function?
There was a problem hiding this comment.
The Gunicorn command now requires deployment-specific logic (Docker vs non-Docker). Extracting it into build_gunicorn_command() centralizes command construction, makes the behavior testable, avoids duplicating Docker logging logic elsewhere, and keeps start() focused on process startup rather than command assembly.
|
Yes. Gunicorn can log to both a file and Docker's stdout/stderr, but not with a single --log-file option |
Signed-off-by: Deepanshu Tiwari <tiwarideepanshu235@gmail.com>
09fd295 to
182b647
Compare
Implemented the Docker Gunicorn logging fix for CollectOSS #374.
Root cause: Docker already relies on gunicorn_conf.py setting errorlog = '-', but both CLI startup paths passed --log-file, which overrides the config and sends Gunicorn errors only to the file. Docker then has nothing useful to show via docker logs.
Changes:
Added internal Gunicorn command builder: collectoss/application/cli/_gunicorn.py (line 17)
Updated backend startup to omit --log-file in Docker: collectoss/application/cli/backend.py (line 108)
Updated API startup the same way: collectoss/application/cli/api.py (line 65)
Switched Gunicorn config to the current Docker env name and kept errorlog = '-': collectoss/api/gunicorn_conf.py (line 45)
Added focused regression tests: tests/test_application/test_cli/test_gunicorn_command.py (line 7)
Fixes #374