pino icon indicating copy to clipboard operation
pino copied to clipboard

support the core report API in some way

Open davidmarkclements opened this issue 5 years ago • 6 comments

see https://nodejs.org/dist/latest-v12.x/docs/api/report.html

This shouldn't land until report comes out of experimental, but integrating with process.report.getReport() so that full reports can be logged in error scenarios might be a cool idea.

Considerations

  • should we do this?
  • is this a core feature?
  • should it only apply in certain scenarios, e.g could we auto attach it to pino.fatal logs?
  • report is opt-in via the command line flags, but should we also make an option for it or just check for process.report and do the right thing if it's present
  • is there a way to bubble this up so that it's also a useful fastify feature (maybe it's just a matter of documentation?)

cc @delvedor

davidmarkclements avatar Apr 13 '20 01:04 davidmarkclements

I'd be okay with documentation that describes scenarios on how to use it and log it. But I'm not keen on forcing this with fatal logs. While the recommendation is that the process exit on a fatal log, it is by no means a hard and fast rule. Plus, it looks like this report could possibly contain sensitive information. It should be very opt-in; the developer should have to do some work to get the output.

jsumners avatar Apr 13 '20 02:04 jsumners

report is already out of experimental on 13.x: https://nodejs.org/dist/latest-v13.x/docs/api/report.html.

We can already work on this.

mcollina avatar Apr 13 '20 10:04 mcollina

I think's just a matter of documentation.

We might want to include it in: http://getpino.io/#/docs/api?id=pino-final.

mcollina avatar Apr 13 '20 10:04 mcollina

I'm leaning towards docs as well, but maybe there's also an opportunity for an ecosystem module that captures, redacts, outputs - all as part of final (and we can link to that in the docs as well). Sort of a balance between informing and avoiding hand rolling

davidmarkclements avatar Apr 30 '20 15:04 davidmarkclements

Sure.

jsumners avatar Apr 30 '20 15:04 jsumners

Perfect!

mcollina avatar Apr 30 '20 18:04 mcollina