Overview
Add structured JSON logging with configurable log levels across the API and worker processes, replacing any ad-hoc console output.
Motivation
Production debugging requires structured, filterable logs. Currently the API and worker processes use inconsistent logging — some use fmt.Println, some use logrus. Structured JSON logs enable better integration with log aggregation tools like Datadog, Grafana Loki, or ELK.
Proposed Design
- Adopt a single structured logger (zerolog or slog) across both cmd/api and cmd/worker
- All log entries include: timestamp, level, message, request_id, tenant_id, operation
- Log levels configurable via LOG_LEVEL environment variable (debug, info, warn, error)
- HTTP request logging middleware adds request_id to all request-scoped logs
- Error logs include stack traces at debug level
- Sensitive fields (API keys, wallet secrets) are automatically redacted
Acceptance Criteria
Overview
Add structured JSON logging with configurable log levels across the API and worker processes, replacing any ad-hoc console output.
Motivation
Production debugging requires structured, filterable logs. Currently the API and worker processes use inconsistent logging — some use fmt.Println, some use logrus. Structured JSON logs enable better integration with log aggregation tools like Datadog, Grafana Loki, or ELK.
Proposed Design
Acceptance Criteria