-
First Check
Commit to Help
Example CodeIdeal shell command:
fastapi run app/main.py --log-level debugDescriptionIt would be great to be able to specify the log-level to the Operating SystemLinux Operating System DetailsNo response FastAPI Version0.120.1 Pydantic Version2.12.3 Python Version3.13 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hello, thanks for your question. TL;DRNo, it is currently not possible to specify the log level (e.g., ExplanationThe
|
Beta Was this translation helpful? Give feedback.
Hello, thanks for your question.
TL;DR
No, it is currently not possible to specify the log level (e.g.,
--log-level debug) using thefastapi runorfastapi devcommands.Explanation
The
fastapiCLI presently hardcodes the logging configuration for the underlying Uvicorn server toINFO(ref code 1 and 2). It does not expose a flag to change this, nor does it respect standard environment variables likeUVICORN_LOG_LEVELbecause the explicit internal configuration overrides them.--verboseflagYou might have noticed a
--verboseflag 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β¦