-
Notifications
You must be signed in to change notification settings - Fork 861
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
Redaction doesn't work on Browser #670
Comments
The docs are probably not worded correctly. I didn’t think there would be a
demand for redaction in the browser, since you’d probably want to send any
relevant info over the wire. However, it’s definitely doable if you have a
need for it, and if you send a PR I’ll review it ASAP.
…On Sun, 23 Jun 2019 at 08:48, Simon Emms ***@***.***> wrote:
Versions:
Pino: 5.12.6
Node: various, including 10.15.3
Browser: various, including Firefox 67, Chrome 75
I'm running Pino for both my front end and back end apps and the redaction
doesn't seem to work in browser mode.
Backend
const pino = require('pino');const logger = pino({
name: 'test',
level: 'info',
redact: [
'password'
]
});
logger.info({ password: 'pass1', hello: 'world' }, 'Password test');
This outputs:
{
"level":30,
"time":1561304419142,
"pid":8064,
"hostname":"hostname",
"name":"test",
"password":"[Redacted]",
"hello":"world",
"msg":"Password test",
"v":1
}
However, the same code in a browser displays the password as pass1
without redaction, even with the browser config options:
const pino = require('pino');const logger = pino({
name: 'test',
level: 'info',
redact: [
'password'
],
browser: {
asObject: true,
serialize: true
}
});
From looking through the code, it doesn't seem to be applied at all but
the documentation for redaction implies that this should work the same for
browser and server.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#670?email_source=notifications&email_token=AAJCWPHYQR52CKCS3TVXHJTP36LNJA5CNFSM4H2ZGPB2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3EZHCQ>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAJCWPAXD2TITSWMR663HR3P36LNJANCNFSM4H2ZGPBQ>
.
|
Nah, I don't have any particular need for it. I was trying something out and noticed that the redaction doesn't work. All it probably needs is a one-liner in the docs (will raise PR with this in soon) |
I would like to upvote need for redaction in browser. Use case: Application that is a react app that needs to log errors/etc and then dump for remote debugging logs. |
@amcdnl a PR would be more than welcome |
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. |
Versions:
Pino: 5.12.6
Node: various, including 10.15.3
Browser: various, including Firefox 67, Chrome 75
I'm running Pino for both my front end and back end apps and the redaction doesn't seem to work in browser mode.
Backend
This outputs:
However, the same code in a browser displays the
password
aspass1
without redaction, even with thebrowser
config options:From looking through the code, it doesn't seem to be applied at all but the documentation for redaction implies that this should work the same for browser and server.
The text was updated successfully, but these errors were encountered: