meinheld-gunicorn-flask-docker icon indicating copy to clipboard operation
meinheld-gunicorn-flask-docker copied to clipboard

Printing worker logs

Open multimeric opened this issue 4 years ago • 2 comments

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?

multimeric avatar Jan 06 '21 00:01 multimeric

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

multimeric avatar Jan 06 '21 07:01 multimeric

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

odovad avatar Feb 25 '21 11:02 odovad