Emit JSON logs through structlog, including uvicorn and stdlib loggers

configure_logging now builds one processor chain shared by structlog
calls and foreign stdlib records (uvicorn, the consumers' getLogger),
rendered as one JSON object per line on stdout. Tracebacks stay inside
their line instead of splitting into one Docker log entry per frame.

uvicorn.access is deliberately left untouched: --no-access-log works by
disabling its propagation, and re-enabling it would bring access logs
back (and inflate the healthz/lookup line counts the tests rely on).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Movses Aslanyan
2026-10-13 20:27:34 +03:30
co-authored by Claude Opus 5.5
parent 7ddb614ded
commit 7be54a6ff9
2 changed files with 61 additions and 8 deletions
+1
View File
@@ -8,5 +8,6 @@ redis==5.2.1
pydantic==2.10.4
pydantic-settings==2.7.1
python-multipart==0.0.20
structlog==25.5.0
opentelemetry-distro==0.66b1
opentelemetry-exporter-otlp==1.45.1