raygun-winston

Raygun transport for Winston

Usage no npm install needed!

<script type="module">
  import raygunWinston from 'https://cdn.skypack.dev/raygun-winston';
</script>

README

raygun-winston NPM Version Build Status Dependency Status

Raygun transport for winston using the raygun4node library

Installation

Node 0.12+ requires npm.

$ npm install raygun-winston --save

Usage

winston.add(require('raygun-winston'), options)

Instantiate before any other transports to ensure certain metadata properties are removed.

Options

  • apiKey: String - Raygun API key, can be found in your Application General Settings
  • tags: Array - Global tags to be applied to all reports
  • user: Function - Generate user object using passed req object
  • version: String - For version tracking, calls raygun.setVersion

Additionally, any option supported by raygun4node library.

Log Levels

This library only sends logs with the level error all other levels will be ignored.

Metadata

The following winston log metadata properties are used in certain ways:

  • meta.req - Server request object, used for options.user function
    • Removed after log function is invoked
  • meta.err - Replaces generated Error object sent (better stack traces)
  • meta.tags - Custom tags for this specific request.