Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Discussion options

You must be logged in to vote

Hello, thanks for your question.

TL;DR

No, it is currently not possible to specify the log level (e.g., --log-level debug) using the fastapi run or fastapi dev commands.

Explanation

The fastapi CLI presently hardcodes the logging configuration for the underlying Uvicorn server to INFO (ref code 1 and 2). It does not expose a flag to change this, nor does it respect standard environment variables like UVICORN_LOG_LEVEL because the explicit internal configuration overrides them.

--verbose flag

You might have noticed a --verbose flag in the CLI help. For example: fastapi --verbose run app/main.py.

This does not enable debug logs for your application. It only enables debug logging for the fas…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pynchia
Comment options

Answer selected by pynchia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question or problem
2 participants