Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@synapsestudios/winston-sentry

Package Overview
Dependencies
Maintainers
10
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@synapsestudios/winston-sentry

Winston transport for sentry

latest
Source
npmnpm
Version
2.1.0
Version published
Maintainers
10
Created
Source

winston-sentry

CircleCI

A simple winston transport that logs your errors to sentry.

This transport is for winston 3.x and uses the new @sentry/node SDK instead of Raven.

Installation

npm install --save @synapsestudios/winston-sentry

Usage

Follow the steps in sentry's docs to set up your node sdk. The transport doesn't set up the sentry SDK for you in case you want to make any of your own sentry calls outside of the context of winston.

Initialize the transport and tell winston about it like this:

const winston = require('winston');
const SentryTransport = require('@synapsestudios/winston-sentry');
const Sentry = require('@sentry/node');

Sentry.init({
  /* sentry init values */
});


module.exports = new winston.Logger({
  transports: [
    /* ... your other transports */
    new SentryTransport({ Sentry }),
  ]
});

Logging behavior

Whenever an error with level fatal or error are logged with your winston logger that error will also be logged to sentry.

FAQs

Package last updated on 24 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts