trentm/node-bunyan

Provide capability to redact sensitive information

tedyu opened this issue · 1 comments

This issue is for the feature of redaction.

With pino, we can do:

    redact: {
      paths: [
        'req.headers.authorization',
        '*.options.headers.authorization',
        '*.requestOptions.headers.authorization',

We can write custom serializer to recursively inspect the data to redact any sensitive attributes.

It seems the redaction can be done in lib/bunyan.js:

// Serialize an HTTP request.
Logger.stdSerializers.req = function (req) {