bunyan-rollbar-stream
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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')

Readme

Keywords

none

Package Sidebar

Install

npm i bunyan-rollbar-stream

Weekly Downloads

16

Version

1.0.3

License

MIT

Unpacked Size

13.2 kB

Total Files

14

Last publish

Collaborators

  • anasceym