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

[Proposal] support for quietResLogger (similar to quietReqLogger) - log full bindings at start of request instead at the end. #235

Open
manvydasu opened this issue Jun 22, 2022 · 1 comment · May be fixed by #256

Comments

@manvydasu
Copy link

manvydasu commented Jun 22, 2022

It's currently hard to implement following behavior with pino-http:

  1. Log request with headers, url, request params and other required info.
  2. Process request and call log multiple times during the scope of request. Request params, headers, etc.. should NOT be included in these logs.
  3. Log response. Request params, headers, etc... should NOT be added to this log.

It seems like with current functionality we can either add unnecessary metadata to every single log during scope of request (quietReqLogger=false) or add them at the end (quietReqLogger=true).
However, there is no way to easily do the opposite - to add all aditional info at start of request, and do only lightweight logging afterwards. It seems natural, that first log of request scope should include all the metadata (i..e what if request takes way longer than expected or it hangs somehow).

@manvydasu manvydasu changed the title [Proposal] support for quietResLogger(similar to quietReqLogger) [Proposal] support for quietResLogger (similar to quietReqLogger) - log full bindings at start of request instead at the end. Jun 22, 2022
@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

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