-
Notifications
You must be signed in to change notification settings - Fork 117
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
Add log request body example #76
Conversation
cc @mcollina |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should note that including body in the logs can cause security risks and have private user information (such as password and other GDPR-protected data) logged and persisted in long-term storage.
Updated as such. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well written, sorry can we also add that logging the request bodies can also significantly affect performance.
We might also want to include an example of using the redact API on a request body
Yes and yes. I am a little unfamiliar about the performance consequences apart from spitting out more bytes in theory reduces performance. Showing how to redact in case you want to log the body but there is sensitive data? This would be great but a little beyond me, could you provide a snippet? |
Yes, including more bytes slows down throughput. I don't have any specific data, because it depends on where you are sending the data to, and how fast that destination is. As for log redaction, you can find it documented at http://getpino.io/#/docs/redaction. |
Changes applied. |
Co-Authored-By: Matteo Collina <matteo.collina@gmail.com>
…into log-body-example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Good work, thanks! |
My pleasure! |
How to log response body? |
Adds an example for a common use case of wanting the request body logged.