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

Best practice: Prettify both HTTP request logs and "normal" log messages #651

Closed
jfahrenkrug opened this issue May 13, 2019 · 4 comments
Closed

Comments

@jfahrenkrug
Copy link

Hi,

I'm a little stuck and want to make sure I'm doing the right thing. I have a Node server that I just converted to using Pino for logging. It works very well, but the express-pino-logger messages are very verbose. I understand that it's the job of another process to prettify the JSON log messages. pino-pretty keeps the verbosity of the HTTP request logs. pino-http-print nicely formats the HTTP request logs, but it filters out my other log messages.

So I can either have all my log message and very verbose HTTP logs, or I can have nicely formatted concise HTTP logs, but none of my other log messages. What's the best way to solve this? Is it only solvable by implementing my own prettifier? If so, it would be great to have an option on pino-pretty to prettify HTTP logs, since that seems a very common use case.

Thanks so much!

@mcollina
Copy link
Member

I think the best approach would be for pino-http-print  to route the messages that are not http logs to pino-pretty internally (maybe with a flag). Would you like to send such a PR?

@jfahrenkrug
Copy link
Author

@mcollina Sounds good! I'll put up a PR.

@jfahrenkrug
Copy link
Author

@mcollina PR is up: pinojs/pino-http-print#1

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants