Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pino logger with correlation id #75

Open
omeralon1 opened this issue Feb 14, 2024 · 1 comment
Open

Use pino logger with correlation id #75

omeralon1 opened this issue Feb 14, 2024 · 1 comment

Comments

@omeralon1
Copy link

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants