Format stdout from pino to a known stackdriver format. Should also be compatible with bunyan output.


511.0.15 years ago5 years agoMinified + gzip package size for @advinans/pino-stackdriver in KB


Format stdout from pino to Stackdriver format

This does not transport the logs to Stackdriver but is meant to be used with the Stackdriver agent.


$ node myscript.js | psdriver


When a stack trace is present it is put on the message property and any string message is put on the msg property.

log.error(new Error('Oops!'), 'Something is fishy'); // stdout => {"severity":"ERROR","timestamp":1507216273883,"message":"Error: Oops!\n    at Object.<anonymous> (...)\n    at Module._compile (module.js:624:30)\n    at Module.m._compile (...)\n    at Module._extensions..js (module.js:635:10)\n    at Object.require.extensions.(anonymous function) [as .ts] (...)\n    at Module.load (module.js:545:32)\n    at tryModuleLoad (module.js:508:12)\n    at Function.Module._load (module.js:500:3)\n    at Function.Module.runMain (module.js:665:10)\n    at Object.<anonymous> (...)","msg":"Something is fishy"}


This package should be compatible with Bunyan as it has the same output, but it is untested.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.