I'm just starting out using pino and I am trying to serialize an error object but it doesn't work. This is the code I am using:
const log = pino({
name: "pino",
timestamp: pino.stdTimeFunctions.isoTime,
level: "trace",
serializers: {
err: e=> ({
type: e.type,
message: e.message,
stack: e.stack
})
}
})