pino
pino copied to clipboard
Multiple redaction rules?
Is it possible to use multiple redaction rules? E.g. something like:
pino({
redact: [
{
paths: ['req.headers.authorization'],
},
{
paths: ['req.id'],
remove: true,
},
],
})
I want the value at req.headers.authorization to be replaced by a censor (in this case, the default "[Redacted]") but i also want the key req.id to be completely removed. The code above doesn't work, as redact can only be a single object or an array of strings (paths), but is there some recommended way to pull this off?
https://github.com/pinojs/pino/blob/ef5e2e64164af01967b033c186910a6eb6f4cd7a/docs/api.md#serializers-object
@mziwisky Did you manage to resolve this?
I did not resolve this, but I don't use pino anymore, so we're good.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.