winston-newrelic-logs-transport

NewRelic Logs API Transport for Winston

Usage no npm install needed!

<script type="module">
  import winstonNewrelicLogsTransport from 'https://cdn.skypack.dev/winston-newrelic-logs-transport';
</script>

README

winston-newrelic-logs-transport

A [newrelic][http://newrelic.com/] Logs API transport for [winston][https://github.com/flatiron/winston].

Installation

Tested on node-14.x.

  $ npm install winston-newrelic-logs-transport --save

Usage

import { createLogger } from 'winston';
import WinstonNewrelicLogsTransport from 'winston-newrelic-logs-transport';
const logger = createLogger({
    transports: [
        new WinstonNewrelicLogsTransport({
            licenseKey: process.env.NEW_RELIC_LICENSE_KEY,
            apiUrl: process.env.NEW_RELIC_API_URL,
        }),
    ],
});

Options

  • licenseKey: New Relic license key.
  • apiUrl: New Relic Log Base API URL.