Skip to content

Conversation

@ali-behjati
Copy link
Collaborator

This change switches from console to pino for logging that is a structured logger and allows us to have json formatted loggers. In adition to just that change, pino does an amazing job at logging the errors by including all their data + the stacktrace.

This change does minimal change to the log level and the console.log is changed to info or debug level based on my judgement.

This change is marked as breaking because it breaks any reliability/ops based on the logs.

The attached images show the new log outputs in both pretty and json formats, as well as error logs.

image
image

@ali-behjati ali-behjati requested review from cprussin, jayantk and m30m June 19, 2024 16:14
@vercel
Copy link

vercel bot commented Jun 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2024 9:00am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jun 20, 2024 9:00am

Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pino is awesome! Great call moving this over.

Mostly LGTM but I'd definitely recommend removing pino-pretty from the production dependencies.

I'm not familiar with the interfaces enough here but is there an option to pass a logger instance to any entrypoint that a library would consume? If not, I strongly recommend adding one -- it's very common for apps to have their own pino (or bunyan) instances and to want to use a child logger for a library.

This change switches from `console` to `pino` for logging that is a
structured logger and allows us to have json formatted loggers. In
adition to just that change, pino does an amazing job at logging the
errors by including all their data + the stacktrace.

This change does minimal change to the log level and the `console.log`
is changed to info or debug level based on my judgement.

This change is marked as breaking because it breaks any reliability/ops
based on the logs.
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 this pull request may close these issues.

4 participants