meinheld-gunicorn-flask-docker
meinheld-gunicorn-flask-docker copied to clipboard
Printing worker logs
If I add a worker-level gunicorn hook to my gunicorn_conf.py
, for example:
accesslog = '-'
loglevel = 'debug'
errorlog = '-'
capture_output = True
def post_request(worker, req, environ, resp):
worker.log.info(req)
worker.log.info(environ)
worker.log.info(resp)
These logs never show up in the docker logs
. I know this config file is being correctly loaded, however, as it prints out my custom config on startup. How can I get these logs to go the stdout and thus the docker logs
?
Update: this seems to be a fault in the meinheld worker, which is something I believe should be documented for these docker images as well. For more info refer to my issue here: https://github.com/mopemope/meinheld/issues/118
Hi, same issue I think? I only see logs in case of an error.
If everything works well, I only see :
[2021-02-25 10:58:58 +0000] [7] [INFO] Booting worker with pid: 7
[2021-02-25 10:58:58 +0000] [8] [INFO] Booting worker with pid: 8
[2021-02-25 10:58:58 +0000] [9] [INFO] Booting worker with pid: 9