This package provides a Rollbar transport for the Notera package.
Example usage with Notera:
const Notera = require('notera')
const noteraTransportRollbar = require('notera-transport-rollbar')
const Rollbar = require('rollbar');
const rollbar = new Rollbar({ accessToken: 'YOUR_TOKEN_HERE' });
const logger = new Notera();
logger.on('error', err => {
console.log('Some unexpected happened during logging', err)
})
logger.addTransport(noteraTransportRollbar({
rollbar
// More options
}))
// Use logger as usual
logger.ctx('SERVER').info('Something is up', { some: 'meta' })
interface Options {
// Instance of Rollbar
rollbar: Rollbar;
// Override mappings of Notera logging levels against Rollbar levels.
// Defaults to:
// emerg: 'critical',
// alert: 'critical',
// crit: 'critical',
// err: 'error',
// warning: 'warning',
// notice: 'warning',
// info: 'info',
// debug: 'debug'
levelMap?: [level: string]: string;
}
npm install notera-transport-rollbar
yarn add notera-transport-rollbar