Goal / Acceptance criteria:\n\nEnsure structured application logs are shipped to Loki when LOKI_ENABLED true, otherwise fall back to a rotating file handler.\n\n• Expand app/utils/observability.py to attach RotatingFileHandler when Loki disabled.\n• Clarify log format (json) so Tempo trace_id correlation works.\n• Expose .env.example variables: LOKI_ENABLED, LOKI_ENDPOINT, LOKI_EXTRA_LABELS.\n• Add README snippet on running loki+promtail via docker-compose.\n• Integration test: emits error log, asserts JSON reaches local Loki test container.\n\nContext: Prompt 2025-07-07 – Python Observability Guide discussion.
Goal / Acceptance criteria:\n\nEnsure structured application logs are shipped to Loki when LOKI_ENABLED true, otherwise fall back to a rotating file handler.\n\n• Expand app/utils/observability.py to attach RotatingFileHandler when Loki disabled.\n• Clarify log format (json) so Tempo trace_id correlation works.\n• Expose .env.example variables: LOKI_ENABLED, LOKI_ENDPOINT, LOKI_EXTRA_LABELS.\n• Add README snippet on running loki+promtail via docker-compose.\n• Integration test: emits error log, asserts JSON reaches local Loki test container.\n\nContext: Prompt 2025-07-07 – Python Observability Guide discussion.