pino
pino copied to clipboard
support the core report API in some way
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.fatallogs? - report is opt-in via the command line flags, but should we also make an option for it or just check for
process.reportand 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
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.
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.
I think's just a matter of documentation.
We might want to include it in: http://getpino.io/#/docs/api?id=pino-final.
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
Sure.
Perfect!