Skip to content

feat: implement structured logging globally#85

Merged
heitorrsdev merged 4 commits intomainfrom
feat/structured-logging
Apr 13, 2026
Merged

feat: implement structured logging globally#85
heitorrsdev merged 4 commits intomainfrom
feat/structured-logging

Conversation

@heitorrsdev
Copy link
Copy Markdown
Owner

Description

Implemented global structured logging replacing the default NestJS console logger with nestjs-pino.

What was done

  • Added nestjs-pino and pino-http dependencies
  • Configured JSON output for production and pretty-printing for local environments
  • Implemented automatic PII Masking (e.g., passwords, emails, tokens)
  • Enforced correlation ID tracing for request context tracking
  • Drafted ADR 0015 detailing the architectural decision around logging

Why

Standard console.log methods are synchronous, lack JSON formatting necessary for scalable cloud ingestion (like Datadog), and pose security risks by potentially leaking sensitive credentials. Using Pino addresses all formatting, performance, and security-compliance concerns natively.

@heitorrsdev heitorrsdev merged commit 2239b61 into main Apr 13, 2026
1 check passed
@heitorrsdev heitorrsdev deleted the feat/structured-logging branch April 13, 2026 20:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant