Repository navigation
Mirrors the v0.5.0 Django exception-path fix onto the Starlette/pure-ASGI middleware (#44).
uv add "git+https://github.com/collide-ai/collide-logging-py.git@v0.5.1"Fixed
starlette.RequestLoggingMiddlewareskipped thehttp.requestline when the wrapped app raised (#44). The line was emitted afterawait self.app(...)returned, so an unhandled exception jumped past it into thefinallyand the genuinely-unhandled 500 produced no request log. The middleware now emits a status-500http.requestline aterrorlevel with the traceback (exc_info) before re-raising. No response exists on that path, soX-Request-IDis not set and the status is reported as 500 even ifhttp.response.startalready fired;request_idstill rides the bound contextvar. ASGI analogue of the Django exception-path fix shipped in v0.5.0.
Notes
- The streaming-duration (#41) and client-disconnect (#42) concerns do not apply to pure-ASGI:
await self.app(...)returns only after the body drains, so itsduration_msis already correct. CLAUDE.mdgains a "Request logging guarantees" section documenting the cross-adapter middleware contract, including the open #42 Django known limitation.
Full prior history: v0.5.0 (Django middleware overhaul) — see CHANGELOG.