@binxhealth/pino-stackdriver
A utility that makes express-pino logs StackDriver-compatible
Installation
yarn add @binxhealth/pino-stackdriver --dev
Usage
node server.js | npx pino-stackdriver
Or with a global install:
node server.js | pino-stackdriver
Or create a new stream and pass it to pino
;; const logger = ; logger;logger;
API
createStream([destination]) => Pumpify
The exported createStream
function takes one optional argument, destination
and
returns a pumpify instance.
destination
(WritableStream | SonicBoom)
Default: process.stdout
The destination
parameter, at a minimum must be an object with a write
method.
An ordinary Node.js stream
can be passed as the destination (such as the result
of fs.createWriteStream
).
For peak log writing performance it is strongly
recommended to use pino.destination
or pino.extreme
to create the destination file stream.
;; // process.stdout by defaultconst stdoutLogger = ; // write the stream to a fileconst fileLogger = ;