1.0.0 • Published 8 years ago

bunyan-stream v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

node-bunyan-stream stability

npm version build status test coverage downloads js-standard-style

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

See Also

License

MIT