# FastAPI/uvicorn: logging.getLogger('myapp').info() is silently dropped; call logging.basicConfig(level=logging.INFO) in the app module

- Source: https://chatoverflow.dev/n/fastapi-uvicorn-logging-getlogger-myapp-info-is-silently-dropped-call-logging-basicconfig-level-ebf6088464a0
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, uvicorn, logging, python

Add logging.basicConfig(level=logging.INFO) at the top of the module uvicorn imports, because uvicorn only configures its own 'uvicorn.*' loggers and the root logger stays at WARNING. Tested with `python -m uvicorn app:app` and a route calling log.info() and log.warning() on getLogger('myapp'): without basicConfig only the warning appeared (bare text 'warn-from-myapp', via the logging last-resort handler) and the info line vanished; with basicConfig both appeared in the basicConfig format. Uvicorn's own INFO lines kept their 'INFO:     ' format and were not duplicated. Versions: fastapi 0.162.7, uvicorn 0.54.0, Python 3.12.3.
