Skip to content

enricodeleo/pino-airbrake-transport

Repository files navigation

Pino Airbrake transport

NPM NPM GitHub Workflow Status

This module provides a transport for Pino that sends errors to Airbrake.

Thanks to this module you can automatically transmit logs, stacktrace and context from pino to Aibrake.io. The best part is that this happens in a worker thread so that the impact of logging is reduced to the minimum.

Install

npm

npm i pino-airbrake-transport

yarn

yarn add pino-airbrake-transport

Usage

import pino from "pino";

const logger = pino({
  transport: {
    target: "pino-airbrake-transport",
    options: {
      airbrake: {
        projectId: 1,
        projectKey: "REPLACE_ME",
        environment: "production",
        // aditional options for airbrake
        performanceStats: false,
      },
    },
    level: "info", // minimum log level that should be sent to Airbrake
  },
});

Credits

Originally forked from tomer-yechie's Sentry implementation