nestjs-pino
nestjs-pino copied to clipboard
[QUESTION] how to use logger.assign with graphql
[x] I've read the docs of nestjs-pino
[x] I've read the docs of pino
[x] I couldn't find the same question about nestjs-pino
Question
How i can use logger.assign with nestjs graphql
PinoLoggerModule.forRoot({
pinoHttp: {
logger: logger,
autoLogging: false,
},
forRoutes: [AppController, '*', { path: '/graphql', method: RequestMethod.ALL }],
exclude: [{ method: RequestMethod.ALL, path: 'check' }],
}),
I get the error unable to assign extra fields out of request scope
Please mention other relevant information such as Node.js version and Operating System.
I tried with https://github.com/iamolegga/nestjs-pino/issues/788#issuecomment-1019321440 but it doesn't work as expected
There are not any tests for assign in gql context, should be checked separately. You can try to create a test for this if you want to. I'll get back to this when I'll have free time