1.3.1 • Published 10 months ago

winston-newrelic-logs-transport v1.3.1

Weekly downloads
4
License
MIT
Repository
-
Last release
10 months ago

winston-newrelic-logs-transport

A newrelic Logs API transport for 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.
  • axiosOptions: Options passed to Axios when sending data. (Optional)
  • batchSize: How many log items you would like to bundle together before posting to loggly. (Optional, positive integer or true, default 100)
  • batchThrottle: The maximum frequency the batch posting should occur unless the batch size is exceeded. (Optional, positive integer or true, default 1000)

Batching

If either batching option is set without the other, or simply set as true then default values are used as specified.