pino-bugsnag-transport
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Pino Bugsnag transport

license npm version GitHub Workflow Status

A transport for sending pino error logs to Bugsnag.

Install

npm i @bugsnag/node pino-bugsnag-transport

Usage

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 instance
  • errorKey - Match the pino option when not using the standard error key
  • messageKey - Match the pino option when not using the standard message key
  • minLevel - The minimum log level to meet before sending to Bugsnag, default: 'warn' / 40
  • warningLevel - The minimum log level for errors to be marked as warnings (and not info), default: 'warn' / 40
  • errorLevel - The minimum log level for errors to be marked as warnings (and not error), default: 'error' / 50
  • withLogRecord - Send the entire log record to bugsnag as metadata, default: true
  • onError - Provide a callback passed as the second argument to Bugsnag.notify for full customization

Readme

Keywords

none

Package Sidebar

Install

npm i pino-bugsnag-transport

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

36.2 kB

Total Files

30

Last publish

Collaborators

  • marnusw