Skip to content

chore(logging): implement enterprise structured JSON logging #32

Description

@0dillon

Summary

We are currently relying on standard console.log and console.error throughout the API layer. In our Render production environment, these unstructured logs are virtually impossible to aggregate, index, or search effectively using Datadog. This lack of observability severely hampers our incident response time during outages.

We need to strip out all native console methods and replace them with a robust Winston logger configuration. The new logger must output strictly formatted JSON payloads, automatically inject request correlation IDs, and seamlessly integrate with our error handling middleware to capture full stack traces. Most importantly, PII (Personally Identifiable Information) must be heavily redacted before any payload is emitted.

Acceptance Criteria

  • Install and configure winston with a JSON transport.
  • Implement an Express middleware to attach x-correlation-id.
  • Configure a redaction layer for sensitive fields (e.g., emails, passwords).
  • Replace all existing console usage across the src/ directory.

Tech Stack

TypeScript (Node.js 24), winston, Express. Ensure Datadog compatibility.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions