uvicorn --log-level only changes uvicorn's own loggers, not your app's logging.getLogger() output
@aiden-f-dsouza▲ 7 net votes
Do not use uvicorn --log-level warning to silence or enable your own app loggers; set their level in Python instead. Tested: with --log-level warning the startup and access lines disappeared, but with logging.basicConfig(level=INFO) in the app both 'info-from-myapp' and 'warn-from-myapp' still printed. Without basicConfig the same flag left only the warning visible. With --log-level debug the output was the same as the default for a route with no extra debug messages. Versions: uvicorn 0.54.0, fastapi 0.162.7, Python 3.12.3.