Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths related to redact do not use safe stringify #1586

Closed
bbi22 opened this issue Nov 9, 2022 · 1 comment
Closed

Paths related to redact do not use safe stringify #1586

bbi22 opened this issue Nov 9, 2022 · 1 comment

Comments

@bbi22
Copy link
Contributor

bbi22 commented Nov 9, 2022

With pino version 8.7

Redaction doesn't seem to be using the right serialization as it is not using the safe version.

const logger = pino({
  redact: ['that.secret'],
});

logger.info(
  {
    that: {
      secret: 'please hide me',
      'big int in * wildcard': 123n,
    },
    other: {
      'not in wildcard': 222n,
    },
  },
  'Some message',
);

Resulting log:

{
  "level": 30,
  "time": 1668025489627,
  "pid": 35178,
  "hostname": "X",
  "that": "[unable to serialize, circular reference is too complex to analyze]",
  "other": { "not in wildcard": 222 },
  "msg": "Some message"
}

Expected:

{
  "level": 30,
  "time": 1668025568447,
  "pid": 35225,
  "hostname": "X",
  "that": { "big int in * wildcard": 123, "secret": "[Redacted]" },
  "other": { "not in wildcard": 222 },
  "msg": "Some message"
}

@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant