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

Redact option is not usable #118

Open
Ninerian opened this issue Mar 18, 2022 · 2 comments
Open

Redact option is not usable #118

Ninerian opened this issue Mar 18, 2022 · 2 comments
Labels

Comments

@Ninerian
Copy link

Hello thanks for this library. It is really useful.

After working a while with it, I wanted to use the redact feature of pino to remove some sensitive information from the loglines. Unfortunately I found an unwanted behavior.

In this sandbox I've added a minimal example where I both defined the redact property in the pino and hapiPino property of the laabr options. The property in the hapiPino setting is completely ignored, as the Pino instance is created inside the logger.js without passing the options to Pino. When hapi-pino is initialized, it reuses the pino instance, but is unable to inject the redact settings, as they are used at the construction of Pino.

When the property in the pino setting is enabled, an exception is thrown. This results from the redact function which returns a string, this is then passed to the prettifier function in laabr. At the validation step for the preformatter an error is thrown, as it expects an Object.

I hope this helps to find a solution for this bug.

@felixheck
Copy link
Owner

Thanks, Daniel for raising this issue and providing the sandbox — much appreciated. Let me delve into this issue, sounds like a fun topic. It might take a while as I'm pretty busy right now.

@felixheck felixheck added the bug label Mar 18, 2022
@felixheck
Copy link
Owner

In case you wanna tackle it and submit a PR: go for it 😉

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

No branches or pull requests

2 participants