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

nestedKey now working properly #307

Open
stychu opened this issue Nov 14, 2023 · 1 comment
Open

nestedKey now working properly #307

stychu opened this issue Nov 14, 2023 · 1 comment

Comments

@stychu
Copy link

stychu commented Nov 14, 2023

I have this pinohttp logger setup with nestedKey. The log is not respecting req property to go inside the nestedKey if defined.

export const httpLoggerMiddleware = pinoHttp({
  redact: ['req.headers', 'res.headers'],
  msgPrefix: '[HTTP] ',
  nestedKey: 'logPayload',
});
  req: {
      "id": 4,
      "method": "GET",
      "url": "/asdsadad",
      "query": {
        "batch": "1",
      },
      "params": {},
      "headers": "[Redacted]",
      "remoteAddress": "::1",
      "remotePort": 52680
    }
    logPayload: {
      "res": {
        "statusCode": 200,
        "headers": "[Redacted]"
      },
      "responseTime": 15
    }
@mcollina
Copy link
Member

This looks like a bug! Would you like to send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants