Is there a papertrail transporter for pino?
not as far as I know, but you can write one!
noooooooo, whyyyyy.
Because we don't use every system that is available and can't be expected to write everything ourselves. This is open source software, written to meet our needs, that is provided as-is. Contributions for desired functionality is encouraged and welcomed.
@CoolHandLuke88 if you want to build it, we'll even review and help you make it as performant as it can be
Hey guys love what you have done with Pino. @jsumners I completely understand. @davidmarkclements I am considering it, if time will allow me. I would love for you guys to review and assist if I do it. You guys will be first to know of the repo. Thanks for all the hard work.
i'm just trying papertrail for the first time, but ostensibly it's already supported via pino-syslog + pino-socket.
i'm running:
$ node index.js | pino-syslog | pino-socket -a logs.papertrailapp.com -p xxxx
and this seems to show up fine in my papertrail dashboard.
Is this a full solution?
Ok so that's straight forward
For convenience what you could do is create pino-papertrail module that combines pino-syslog and pino-socket
Give it both CLI interface and programmatic (for use with pino-multistream for those who have constrained environments that don't allow for for shell piping), add unit tests and we can make it an official module if you like
thanks @davidmarkclements
one apparent limitation i noticed is that the output sent to papertrail is in the raw json format. i.e., this arrangement of CLI args:
$ node index.js | pino | pino-syslog | pino-socket -a logs.papertrailapp.com -p xxxx
doesn't send any content to papertrail.
In general it looks like putting pino before pino-syslog breaks the latter. is that a hard constraint of pino-syslog or a design choice that could be reconsidered? would be cool to have stuff in papertrail pretty-printed
@brandonmp yes. pino-syslog is for parsing the newline delimited JSON log lines into traditional syslog format. Piping those log lines into pino transforms them into human readable information.
Just created an initial version of the Papertrail transport for Pino.
Inspired by: pino-syslog, pino-socket and winston-papertrail
Please check it out here: https://github.com/ovhemert/pino-papertrail
or, install it right away:
npm install pino-papertrail
It currently only supports UDP socket.
Tests and more options are on the way.
Feel free to make suggestions on how to improve performance.
Good work! Would you mind sending a PR to https://github.com/pinojs/pino/blob/master/docs/transports.md as well?
Most helpful comment
Ok so that's straight forward
For convenience what you could do is create pino-papertrail module that combines pino-syslog and pino-socket
Give it both CLI interface and programmatic (for use with pino-multistream for those who have constrained environments that don't allow for for shell piping), add unit tests and we can make it an official module if you like