How to get route info logs from FastAPI application #1112
-
When deploying a FastAPI application with uvicorn or something similar, we usually see logs such as: But when we switched to Nginx Unit, we can't see such logs anymore. Is there a known method for restoring this behavior? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
Not sure if this is exactly what you mean but you can configure access logs in Unit via https://unit.nginx.org/configuration/#access-log |
Beta Was this translation helpful? Give feedback.
-
Conditional logging was committed last week and will be in the next release. See #1044 |
Beta Was this translation helpful? Give feedback.
Hi -
--no-daemon
is fine. Theaccess_log
can be pointed tostdout
. Your configuration will look likeAs you are running on a quite old version (please consider to update to 1.31.1) the docs are pointing to the latest version. With 1.26 there was no configurable access log format. This was introduces in 1.28.
Update: My minimal Docker-Test:
Unit configuratio…