nest
nest copied to clipboard
[Feature Request] @nestjs/platform-fastify support Custom Log Level
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