1.1.1 • Published 3 years ago
pino-bugsnag-transport v1.1.1
Pino Bugsnag transport
A transport for sending pino error logs to Bugsnag.
Install
npm i @bugsnag/node pino-bugsnag-transportUsage
import pino from 'pino'
import Bugsnag from '@bugsnag/node'
const logger = pino({
transport: {
target: 'pino-bugsnag-transport',
options: {
bugsnag: Bugsnag, // required
errorKey: 'err',
messageKey: 'msg',
minLevel: 'warn',
warningLevel: 'warn',
errorLevel: 'error',
withLogRecord: true,
onError: (event, cb) => {},
},
},
})Options
bugsnag- Pass the initialized static Bugsnag instanceerrorKey- Match the pino option when not using the standard error keymessageKey- Match the pino option when not using the standard message keyminLevel- The minimum log level to meet before sending to Bugsnag, default:'warn'/40warningLevel- The minimum log level for errors to be marked as warnings (and notinfo), default:'warn'/40errorLevel- The minimum log level for errors to be marked as warnings (and noterror), default:'error'/50withLogRecord- Send the entire log record to bugsnag as metadata, default:trueonError- Provide a callback passed as the second argument toBugsnag.notifyfor full customization