Description: Refactor the API's global logging architecture to output strictly formatted JSON strings rather than raw console text, preparing the application for ingestion by centralized monitoring tools like AWS CloudWatch or the ELK stack.
Context / Motivation: Standard console.log is useless at scale. When troubleshooting production issues across load-balanced containers, we need structured metadata (timestamps, request IDs, log levels) to filter and query logs effectively.
Acceptance Criteria: - [ ] Replace all standard console calls with a high-performance logging library like Pino or Winston.
Description: Refactor the API's global logging architecture to output strictly formatted JSON strings rather than raw console text, preparing the application for ingestion by centralized monitoring tools like AWS CloudWatch or the ELK stack.
Context / Motivation: Standard
console.logis useless at scale. When troubleshooting production issues across load-balanced containers, we need structured metadata (timestamps, request IDs, log levels) to filter and query logs effectively.Acceptance Criteria: - [ ] Replace all standard
consolecalls with a high-performance logging library likePinoorWinston.{"level":"info","time":167890,"msg":"...","reqId":"xyz"}).Technical Pointers: Add a correlation ID (
X-Request-ID) to the initial request payload and pass it down through the controllers so you can trace a single user's action across all corresponding database logs.