JSON formatted logging with Flask and gunicorn

前端 未结 1 983
既然无缘
既然无缘 2021-02-07 15:52

I am trying to do something very similar to what\'s explained here: https://sebest.github.io/post/protips-using-gunicorn-inside-a-docker-image/

I want to get my Flask ap

1条回答
  •  北荒
    北荒 (楼主)
    2021-02-07 16:33

    to get the access log as well your config file should look something like this:

    [loggers]
    keys=root, gunicorn.error, gunicorn.access
    ...
    [logger_gunicorn.access]
    level=(DEBUG|INFO|ERROR)
    handlers=console
    propagate=0
    qualname=gunicorn.access
    

    The accesses are logged in the INFO log level, so if you want to show them make sure you have the log level within the "logger_gunicorn.access" tag set to at least INFO

    0 讨论(0)
提交回复
热议问题