1.0.3 • Published 5 years ago

bunyan-rollbar-stream v1.0.3

Weekly downloads
247
License
MIT
Repository
github
Last release
5 years ago

bunyan-rollbar-stream

Bunyan stream for sending Rollbar

NPM Build Status

Install

With NPM

npm install --save bunyan-rollbar-stream

Usage

import Rollbar from 'rollbar'
import bunyan from 'bunyan'
import BunyanRollbarStream from 'bunyan-rollbar-stream'

var rollbar = new Rollbar({
  accessToken: 'MY-ROLLBAR-ACCESS-TOKEN',
})

var log = bunyan.createLogger({
  name: 'my-app',
  serializers: bunyan.stdSerializers,
  streams: [
    {
      name: 'rollbar',
      stream: new BunyanRollbarStream({
        rollbar: rollbar
      }),
      level: 'error'
    }
  ]
})

// This line will automatically sends error to Rollbar
log.error({ err: new Error('Error') }, 'Some error occurred')
1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago