Skip to content

Structured logging with correlation IDs #14

@howwohmm

Description

@howwohmm

Problem

All logging is `print()` statements. No log levels, no structured format, no correlation IDs. At 1K DAU, debugging from `docker logs` is impossible — can't trace a request through transcript fetch → LLM call → email scheduling.

Solution

  • Replace all `print()` with Python `logging` module
  • Use structured JSON format (for log aggregation)
  • Add request correlation IDs (middleware that sets a request ID)
  • Log levels: DEBUG for verbose, INFO for operations, WARNING for degraded, ERROR for failures

Files

  • All `.py` files — replace `print()` with `logger.info()` etc.
  • `main.py` — add correlation ID middleware

Acceptance Criteria

  • All print statements replaced with structured logging
  • Each request has a traceable correlation ID
  • Log output is JSON-formatted
  • Log levels used appropriately

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — operational paingood first issueGood for newcomersinfraInfrastructure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions