Added logging for startup failures #2415
Unanswered
mingregister
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Scene
We deploy our Uvicorn app in Kubernetes, and we send our logs to the Aliyun log service. However, we've noticed that when the startup fails (e.g: due to a forgotten module import), the error logs are not visible in the Aliyun log service. As a result:
So, Should we added logging for startup failures?
Code and Traceback
Then, use the command
uvicorn main:app --log-config uvicore_config.json
to start up. If it fails to start, the traceback is as follows:Due to the reasons mentioned above, we cannot see the errors in the aliyun log service; we must log in to Kubernetes to view them.
Solution
I've proposed a solution that can be found at this PR. I understand that it may not be the final approach we take, but I welcome your insights and suggestions.
Beta Was this translation helpful? Give feedback.
All reactions