Skip to content

[BACKEND] Add structured JSON logging with request IDs #258

@dev-fatima-24

Description

@dev-fatima-24

Priority: high

Description

The backend currently uses console.log with unstructured output. Structured JSON logging with a unique request ID per request is needed for production observability and log aggregation.

Acceptance Criteria

  • Every log line is valid JSON with timestamp, level, requestId, message
  • Request ID is generated per request and attached to all logs within that request
  • Request ID is returned in the X-Request-ID response header
  • Log level is configurable via environment variable
  • Errors include stack traces in the error field

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions