Logging config not applied for uvicorn in gunicorn #131
Replies: 1 comment 3 replies
|
Thanks for reporting. I'm happy to help with this. The inboard default logging config propagates all the relevant log streams from FastAPI, Gunicorn, and Uvicorn to the root logger, formats all the log messages in the same way, and outputs all messages to In your case, if you are supplying your own logging config, the behavior may be different. The logger that Uvicorn is using in inboard/inboard/logging_conf.py Lines 166 to 174 in a0106c5 If you're supplying inboard/inboard/logging_conf.py Lines 132 to 136 in a0106c5 If you're still having trouble, feel free to share your logging config here and I can take a closer look. |
Uh oh!
There was an error while loading. Please reload this page.
We are running a fastapi service based on inboard/fastapi.
To customize the logging we have defined a custom LOGGING_CONF and LOG_FORMAT.
This is usually correctly applied. It works for guincorn, fastapi and our own code.
However when an unhandled exceptions is raised in the service, it is propagated to uvicorn here: https://github.com/Kludex/uvicorn/blob/main/uvicorn/protocols/http/h11_impl.py#L408
and there it is not logged in the desired format.
Reading https://github.com/br3ndonland/inboard/blob/1b6ea662167e01e09363e035187db105f1c0f278/inboard/gunicorn_workers.py, I guess the idea is that uvicorn uses the gunicorn log handler and it has the correct formatter configured, but somehow that doesn't happen.
All reactions