When --log-config is supplied, exception traceback does not show root cause exception #2227
Unanswered
yunduz
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
When I run uvicorn (with FastAPI) where I supply
--log-config logging.yaml
argument, when an exception is raised, full stack trace is not shown (only the topmost exception and its traceback). However, if I don't supply log config file, then full stack trace down to the original exception is shown.I debugged it down to this line in the
uvicorn
code:raise exc from None
. If I removefrom None
, full stack trace is shown even when--log-config
is supplied.Wondering if it's intentional to clear the original exception?
To reproduce the issue, create the following two files:
Run the app:
uvicorn app:app --port 8201 --reload --log-config logging.yaml
Make request to
localhost:8201/foobar
, observe logs: you'll see that only topmostValueError
withblah 3
is shown in the logs.Beta Was this translation helpful? Give feedback.
All reactions