pino icon indicating copy to clipboard operation
pino copied to clipboard

Multiple redaction rules?

Open mziwisky opened this issue 3 years ago • 1 comments

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?

mziwisky avatar Feb 02 '22 20:02 mziwisky

https://github.com/pinojs/pino/blob/ef5e2e64164af01967b033c186910a6eb6f4cd7a/docs/api.md#serializers-object

jsumners avatar Feb 03 '22 02:02 jsumners

@mziwisky Did you manage to resolve this?

Fdawgs avatar May 29 '23 08:05 Fdawgs

I did not resolve this, but I don't use pino anymore, so we're good.

mziwisky avatar Jun 13 '23 06:06 mziwisky

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.

github-actions[bot] avatar Jul 14 '23 00:07 github-actions[bot]