Skip to content

Simple Rollbar adapter for Bunyan written in TypeScript

License

Notifications You must be signed in to change notification settings

petercipov/ts-bunyan-rollbar

Repository files navigation

ts-bunyan-rollbar

Simple (0 dependencies) Rollbar adapter for Bunyan written in TypeScript

import Rollbar from 'rollbar'
import BunyanLogger from 'bunyan'
import { RollbarStream } from 'ts-bunyan-rollbar'

const rollbar = new Rollbar({
  accessToken: 'token',
  captureUncaught: true,
  captureUnhandledRejections: true
})

const logger = new BunyanLogger({
  name: 'ts-bunyan-rollbar',
  streams: [
    {
      level: 'info',
      type: 'raw',
      stream: new RollbarStream(rollbar)
    }
  ]
})

logger.error({ x: 'extra', err: new Error('some error message') }, 'abcd')

logger.info({ y: 'extra' }, 'abcedf')

logger.info('abcedf')

About

Simple Rollbar adapter for Bunyan written in TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published