#NestJS + Pino

3 messages · Page 1 of 1 (latest)

unique abyss
#

I want to change the logger that Nest uses to pino. There's a package for it here: nestjs-pino.

I've followed the documentation that the package provides, but NestFactory and InstanceLoader do not use the pino logger:

const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
app.useLogger(app.get(Logger));

Is this something I have to put up with, or is it possible to change those loggers too?

Here's the logs:

scarlet moat
#

Add { bufferLogs: true } to the options (thiird parameter) of the NestFactory.create().

unique abyss
#

Perfect. Thank you!