-
Notifications
You must be signed in to change notification settings - Fork 13
Log the req/res body #24
Comments
we don't log them because they could be quite big. They are also very likely to contain personal information you might not want to log anyway. You can just log them yourself |
thank you, it would be nice as an option for scenarios where you know what the bodies should contain ( like internal microservices ) |
Same here. I would like to at least have the option, say, in order to hook in and log out the number of records returned.
e.g. where does |
You’d need a second middleware function. PRs are always welcome - in this case an option that enables the body and always encourages the use of the redact option would be ideal |
Would the PR be in the |
pino-http, thanks! |
@mcollina I think giving the user the possibility to choose whatever he wants to log is important. In my use case, I don't have any huge request bodies, I want to be able to automatically log all of them. I prefer not to have more than one log for each request. Also, for sensitive information, we should be able to hide them 😄 |
pinojs/pino-http#76 created which adds the example as how to achieve logging req body |
Ignore me, the ordering of my middleware was off. |
@naseemkullah do you have an example of logging the response body? pinojs/pino-http#173 |
@ryan-efendy answered in pinojs/pino-http#173 |
Hey there!
This lib is quite excellent.
Only issue: I'd love to log the req and res bodies as they contain useful information.
What is the desired way of doing this?
The text was updated successfully, but these errors were encountered: