Hey there,
we are using pino for the browser. Looks like the serializer for Error instances does not use the provided messageKey when serializing the error. The property from the error object are also not wrapped in an err object, like stated here: https://getpino.io/#/docs/api?id=errors
pino({ browser: { asObject: true, serialize: true }, messageKey: 'message' }).error(new Error('Something went wrong'));
Output in Node:
{"level":50,"time":1739977190475,"err":{"type":"Error","message":"Something went wrong","stack":"Error: Something went wrong ..."},"message":"Something went wrong"}
Output in the browser:
{"time":1739977722493,"level":50,"type":"Error","msg":"Something went wrong","stack":"Error: Something went wrong..."}
Are we doing something wrong?
Hey there,
we are using pino for the browser. Looks like the serializer for
Errorinstances does not use the providedmessageKeywhen serializing the error. The property from the error object are also not wrapped in anerrobject, like stated here: https://getpino.io/#/docs/api?id=errorsOutput in Node:
Output in the browser:
Are we doing something wrong?