pino icon indicating copy to clipboard operation
pino copied to clipboard

Spec

Open yoshuawuyts opened this issue 7 years ago • 7 comments

It'd be great if we could document the JSON spec that Pino uses. This will allow us to implement pino-compatible loggers in other languages (such as Rust, which has my current interest).

It seems that Pino mostly uses the Bunyan spec, but with the addition that time can be a Unix epoch.

Our efforts here should probably be twofold:

  1. gather a comprehensive set of examples of pino output.
  2. write a spec under https://github.com/pinojs/pino/tree/next-major/docs

Porting to Rust

My personal interest is to implement a Rust version, so for me to at least make a start on this would mostly require a collection of pino JSON output. I can then use this to write a serde struct that can parse it. Perhaps this could serve as a good reference for which parts of the spec are missing / unclear.

Unresolved questions

I'm not sure what we should call the spec. Pino? Bunyan? I don't know.

I'm also still a bit unclear on what the right way to extend JSON is. I know I've done some gnarly things in the past, but wanted to check in if there's a better way of approaching this.


Thanks heaps!

Further Reading

  • https://twitter.com/matteocollina/status/1026419876121006081

yoshuawuyts avatar Aug 06 '18 11:08 yoshuawuyts

Absolutely +1 on this, one note - we'll be releasing 5 very soon, so the PR may end up being to master

"Newline delimited JSON logging specification" ?

davidmarkclements avatar Aug 06 '18 11:08 davidmarkclements

NDJSON-log, yeah I can see that work. Probably have to make sure it's clear it's a superset of the http://ndjson.org/ spec.

yoshuawuyts avatar Aug 06 '18 11:08 yoshuawuyts

Yeah - that's perfect

On Mon, 6 Aug 2018 at 07:11, Yoshua Wuyts [email protected] wrote:

NDJSON-log, yeah I can see that work. Probably have to make sure it's clear it's a superset of the http://ndjson.org/ spec.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/pinojs/pino/issues/471#issuecomment-410673689, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIrPIqfHxI7-CcG4PCGwXsC5b89qKM1ks5uOCRVgaJpZM4VwLw7 .

davidmarkclements avatar Aug 06 '18 11:08 davidmarkclements

@yoshuawuyts is this still meaningful to you/still something you want to do?

davidmarkclements avatar Dec 20 '18 17:12 davidmarkclements

@davidmarkclements having a spec would still be useful!

yoshuawuyts avatar Dec 22 '18 11:12 yoshuawuyts

I'm also interest in getting a spec.

My scenario: I'm using some Rust libraries so some part of my program is written in Rust and using Napi it is exposed to nodejs. So, I want to do some logging in Rust code as well. Preferably I'd like to do it from Rust which which can be made Pino-compatible without resorting to Napi or else I need to create wrapper for Pino in Rust.

Any update on this would be helpful.

arjsin avatar Feb 20 '21 06:02 arjsin

This would be great to do... any volunteers?

mcollina avatar Feb 20 '21 10:02 mcollina