How to force uvicorn to print logs in JSON #7726
Replies: 4 comments
-
|
Unfortunately I don't know enough to help here, but you might also try asking in the uvicorn repo, as this question isn't really specific to fastapi in any way. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @vveliev-tc ! Perhaps no longer relevant, but you can create custom handler for uvicorn logger to parse messages into json or something else. Here example with loguru (not json format). |
Beta Was this translation helpful? Give feedback.
-
|
Try this, will help you https://medium.com/1mgofficial/how-to-override-uvicorn-logger-in-fastapi-using-loguru-124133cdcd4e Change log settings |
Beta Was this translation helpful? Give feedback.
-
|
@dmontagu @tiangolo suggestion to close this issue, as this seems specifically related to Uvicorn/aiologger. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
How can I configure uvicorn main logger to print all application messages as JSON using aiologger
Additional context
tried editing . gunicorn_conf.py
Beta Was this translation helpful? Give feedback.
All reactions