bunyan-stream

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i bunyan-stream

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • tabdigital