Summary
Add JSON-structured logging with per-request UUIDs for traceability.
Blocked by
Nothing — this is a starting ticket.
Blocks
Nothing
Steps
- Install
python-json-logger (or use structlog) and add to requirements.txt
- Create
backend/app/middleware/logging.py
- Add middleware that generates a UUID
request_id for every incoming request
- Attach
request_id to all log messages within that request lifecycle
- Configure JSON log format:
{"timestamp", "level", "request_id", "method", "path", "status_code", "duration_ms", "message"}
- Replace any
print() statements with proper logger calls
Acceptance Criteria
Summary
Add JSON-structured logging with per-request UUIDs for traceability.
Blocked by
Nothing — this is a starting ticket.
Blocks
Nothing
Steps
python-json-logger(or usestructlog) and add torequirements.txtbackend/app/middleware/logging.pyrequest_idfor every incoming requestrequest_idto all log messages within that request lifecycle{"timestamp", "level", "request_id", "method", "path", "status_code", "duration_ms", "message"}print()statements with proper logger callsAcceptance Criteria
request_idrequest_idis consistent across all log lines for a single requestprint()statements remain in active codeCloses #83