File tree Expand file tree Collapse file tree
middleware/api/src/middleware/api/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,11 +168,14 @@ def __init__(self, app_config: Config) -> None:
168168
169169 logger .debug ("API configuration: %s" , self ._config .model_dump ())
170170
171- # Apply polling log filter to uvicorn access logger
172- logging .getLogger ("uvicorn.access" ).addFilter (PollingLogFilter ())
173-
174171 @asynccontextmanager
175172 async def lifespan (_app : FastAPI ) -> AsyncGenerator [None , None ]:
173+ # Re-apply our log format after uvicorn has finished its own log setup.
174+ # uvicorn.main() installs its own handlers on uvicorn.access/uvicorn.error
175+ # *after* this module is imported, so we must reconfigure here.
176+ _configure_uvicorn_loggers (self ._config .log_level )
177+ logging .getLogger ("uvicorn.access" ).addFilter (PollingLogFilter ())
178+
176179 # Initialize business logic and its stores
177180 try :
178181 try :
You can’t perform that action at this time.
0 commit comments