nest icon indicating copy to clipboard operation
nest copied to clipboard

[Feature Request] @nestjs/platform-fastify support Custom Log Level

Open daimalou opened this issue 1 year ago • 4 comments
trafficstars

Is there an existing issue that is already proposing this?

  • [X] I have searched the existing issues

Is your feature request related to a problem? Please describe it

I use fastify buildin logger, this logger is awesome, has builtin traceId feature and can access by request.log.info()

https://fastify.dev/docs/v4.28.x/Reference/Logging/

It works.

  const fastifyInstance = fastify({
    logger: true,
  });

  const app = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter(fastifyInstance),
    {
      logger: false,
    },
  );

But this logger log every request and response. I find a solution to close some route. But In Nest I can't find place to config.

solution: https://github.com/fastify/fastify/issues/2120 https://github.com/fastify/help/issues/140 https://fastify.dev/docs/latest/Reference/Routes/#custom-log-level

Describe the solution you'd like

Give a config.

Teachability, documentation, adoption, migration strategy

None

What is the motivation / use case for changing the behavior?

None

daimalou avatar Nov 13 '24 15:11 daimalou