You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The platform uses NestJS's default console logger which outputs unstructured text. In production this is unqueryable by log aggregators (Datadog, CloudWatch, Papertrail). Structured JSON logging with Pino gives every log entry a consistent schema with correlation IDs for request tracing.
Context
backend/src/main.ts — where app.useLogger() is configured
NestJS supports custom loggers via LoggerModule from nestjs-pino
Overview
The platform uses NestJS's default console logger which outputs unstructured text. In production this is unqueryable by log aggregators (Datadog, CloudWatch, Papertrail). Structured JSON logging with Pino gives every log entry a consistent schema with correlation IDs for request tracing.
Context
backend/src/main.ts— whereapp.useLogger()is configuredLoggerModulefromnestjs-pinopino-httpmiddleware provides HTTP request/response logsTasks
npm install nestjs-pino pino-http pino-prettybackend/src/app.module.ts: addLoggerModule.forRoot({ pinoHttp: { ... } })fromnestjs-pinoNODE_ENV=production: plain JSON (no pino-pretty)NODE_ENV=development: human-readable viapino-pretty(transport: { target: 'pino-pretty' })timestamp(ISO 8601),level,context(NestJS module/class name),msg,reqId(auto-generated UUID per request viagenReqId)pino-http: log method, url, statusCode, responseTime on every responseredactoption:['req.headers.authorization', '*.password', '*.totpSecret', '*.smsOtpCode']backend/src/main.ts: callapp.useLogger(app.get(Logger))fromnestjs-pinoto replace NestJS default loggerFiles to Modify / Create
backend/src/main.tsbackend/src/app.module.ts