bunyan-stream
v1.0.0
Published
Stream data into a bunyan logger
Downloads
8
Readme
node-bunyan-stream
Stream data into a bunyan logger. Allows fine grained control over what is logged from a stream.
Installation
$ npm install bunyan-stream
Usage
const bunyanStream = require('bunyan-stream')
const httpNdjson = require('http-ndjson')
const bunyan = require('bunyan')
const logger = bunyan.createLogger({ name: 'myApp' })
http.createServer((req, res) => {
httpNdjson(req, res).pipe(bunyanStream({ level: 'info' }, logger))
res.end()
}).listen()
API
bunyanStream
Create a new bunyan writestream (instanceof through2
). opts
can
contain the following values:
- level: the log level. One of
debug
,info
,warn
,error