-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Labels
BackendbackendbackendStellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
The default NestJS console logger is not suitable for production. We want to implement structured JSON logging using nestjs-pino to make searching and parsing logs in tools like Datadog or ELK much easier.
Acceptance Criteria
- Install
nestjs-pinoandpino-http. - Configure
LoggerModuleglobally inAppModule. - Replace the default NestJS logger in
main.tswith the Pino logger. - Ensure that local development logs are pretty-printed, while production logs are in raw JSON format.
Technical Details/Guide
Install dependencies: npm i nestjs-pino pino-http and npm i -D pino-pretty.
Configure in main.ts:
import { Logger } from 'nestjs-pino';
const app = await NestFactory.create(AppModule, { bufferLogs: true });
app.useLogger(app.get(Logger));Useful Resources
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BackendbackendbackendStellar WaveIssues in the Stellar wave programIssues in the Stellar wave program