Skip to content

feat: integrate structured JSON logging with nestjs-pino#445

Closed
daveades wants to merge 1 commit intoDevsol-01:mainfrom
daveades:feat/structured-logging-nestjs-pino
Closed

feat: integrate structured JSON logging with nestjs-pino#445
daveades wants to merge 1 commit intoDevsol-01:mainfrom
daveades:feat/structured-logging-nestjs-pino

Conversation

@daveades
Copy link
Copy Markdown
Contributor

Summary

  • Installs nestjs-pino, pino-http, and pino-pretty (dev dependency)
  • Configures LoggerModule globally in AppModule using forRootAsync — reads NODE_ENV to switch between pretty-printed (development) and raw JSON (production) output
  • Replaces the default NestJS logger in main.ts with the Pino logger via bufferLogs: true + app.useLogger(app.get(Logger))
  • Replaces console.log startup messages with structured logger calls

Closes #123

Test plan

  • Run locally with NODE_ENV=development — logs should be pretty-printed via pino-pretty
  • Run with NODE_ENV=production — logs should be raw JSON (suitable for Datadog/ELK ingestion)
  • Confirm HTTP request logs appear via pino-http middleware
  • Confirm NestJS bootstrap log messages appear through the Pino logger

🤖 Generated with Claude Code

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@daveades Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nestera Ready Ready Preview, Comment Mar 27, 2026 2:20pm

- Install nestjs-pino, pino-http, and pino-pretty (dev)
- Configure LoggerModule globally in AppModule with async factory
  that reads NODE_ENV: pretty-printed in development, raw JSON in production
- Replace default NestJS logger in main.ts with Pino logger using
  bufferLogs and app.useLogger(app.get(Logger)) pattern
- Replace console.log startup messages with structured logger calls

Closes Devsol-01#123
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.

Integrate Structured Logging

1 participant