Closed EcksDy closed 2 years ago
Didn't get what do you mean by "adapter".
First of all this.logger.error('Custom error message with context', { error, someExtraContext });
does not match with the pino's message format: logger.error([mergingObject], [message], [...interpolationValues]
Second, it has LoggerErrorInterceptor which logs stack trace
Third, for pino to log errors properly it should be passed as .err
filed on merging object. Read this.
Fourth, pino has serializers options.
I hope something of this will help, closing
[V] I've read the docs of nestjs-pino
[V] I've read the docs of pino
[V] I couldn't find the same question about nestjs-pino
Question
Hello,
I'm implementing an adapter that will align our internal logging conventions to nestjs-pino api.
Our error messages are looking as follows:
Is there a way I can manipulate this input to achieve the following behaviour:
Currently in the adapter I manipulate the input into something along the lines of:
All my attempts ended up either losing the error information or being unable to override the message of the output log, as the message on the error object takes precedence.
At this point I'm not sure if this is possible, would love to hear your thoughts, thank you!