ssut / nestjs-sqs

A project to make SQS easier to use within NestJS, with decorator-based handling and seamless NestJS-way integration.
MIT License
203 stars 54 forks source link

Use pino logger with correlation id #75

Open omeralon1 opened 7 months ago

omeralon1 commented 7 months ago

Hi I am using pino logger for nestjs, and add to each log a correlation id. The problem is when the entry point is not via request, the correlation id is missing, and therefore I don't have any tracing in my logs. Is there any solution to work with this module and pino that adds some kind of id to the logs? Thanks!

my log config:

useFactory: (clsService: ClsService) => ({
        pinoHttp: {
          genReqId: () => clsService.getId(),
          ...
        })
    ...
})
jroque-loanpal commented 2 weeks ago

Have you found a solution for this? I need to do something like this as well.