Skip to content

chore(infra): integrate nestjs-pino for structured JSON logging#72

Merged
Oluwaseyi89 merged 1 commit intoNFTopia-Foundation:mainfrom
devxsameer:chore/infra-structured-logging-pino
Feb 19, 2026
Merged

chore(infra): integrate nestjs-pino for structured JSON logging#72
Oluwaseyi89 merged 1 commit intoNFTopia-Foundation:mainfrom
devxsameer:chore/infra-structured-logging-pino

Conversation

@devxsameer
Copy link
Contributor

Closes #13

What was done

  • Replaced the default NestJS logger with nestjs-pino
  • Enabled structured JSON logging across the application
  • Added automatic HTTP request logging (method, URL, status code, response time)
  • Configured severity-based log levels:
    • info → 2xx responses
    • warn → 4xx responses
    • error → 5xx responses
  • Added redaction for sensitive headers (authorization, cookie)
  • Integrated structured exception logging via global HttpExceptionFilter
  • Enabled pretty logs in development and JSON logs in production

Example Log Output

{
  "level": 30,
  "req": { "method": "GET", "url": "/api/v1/health" },
  "res": { "statusCode": 200 },
  "responseTime": 7,
  "msg": "request completed"
}

@Oluwaseyi89 Oluwaseyi89 merged commit 00417f4 into NFTopia-Foundation:main Feb 19, 2026
1 check passed
@Oluwaseyi89
Copy link
Contributor

@devxsameer please, endeavour to star our repository if you haven't done so before.

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.

🪵 Infra: Implement Structured Logging with Pino

2 participants