Is there a way to log python print statements in gunicorn?

前端 未结 4 1223
伪装坚强ぢ
伪装坚强ぢ 2021-02-03 18:58

With my Procfile like this:

web: gunicorn app:app \\
    --bind \"$HOST:$PORT\" \\
    --debug --error-logfile \"-\" \\
    --enable-stdio-inheritance \\
    --r         


        
4条回答
  •  臣服心动
    2021-02-03 19:20

    In python 3, adding flush=True in each print statement works for my flask/gunicorn app.

    E.g.

    gunicorn --bind 0.0.0.0:8080 server --log-level debug
    

    No particular flags are required.

    See if this helps.

提交回复
热议问题