Skip to content

Structured logging with request IDs #83

@krapfj23

Description

@krapfj23

Summary

Add JSON-structured logging with per-request UUIDs for traceability.

Blocked by

Nothing — this is a starting ticket.

Blocks

Nothing

Steps

  1. Install python-json-logger (or use structlog) and add to requirements.txt
  2. Create backend/app/middleware/logging.py
  3. Add middleware that generates a UUID request_id for every incoming request
  4. Attach request_id to all log messages within that request lifecycle
  5. Configure JSON log format: {"timestamp", "level", "request_id", "method", "path", "status_code", "duration_ms", "message"}
  6. Replace any print() statements with proper logger calls

Acceptance Criteria

  • Every request gets a unique request_id
  • Logs are structured JSON
  • request_id is consistent across all log lines for a single request
  • No print() statements remain in active code
  • PR body includes Closes #83

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions