winston-datadog-browser

Send winston logs to Datadog via the browser logs SDK.

Stats

StarsIssuesVersionUpdatedCreatedSize
winston-datadog-browser
001.0.515 days ago3 months agoMinified + gzip package size for winston-datadog-browser in KB

Readme

winston-datadog-browser

npm npm bundle size NPM npm GitHub issues

Send winston logs from the browser to Datadog via the datadog browser logs SDK.

winston-transport + @datadog/browser-logs

Installation

npm install --save winston winston-datadog-browser

Usage

import { configure, format } from 'winston';
import { DatadogBrowserLogs } from 'winston-datadog-browser';

configure({
  transports: [
    new DatadogBrowserLogs({
      clientToken: '<DATADOG_CLIENT_TOKEN>',
      site: '<DATADOG_SITE>',
      forwardErrorsToLogs: true,
      sampleRate: 100,
    }),
    // Optionally, also log to browser console
    new BrowserConsole({
      format: format.simple(),
    }),
  ],
});

Configuration

DatadogBrowserLogs uses the same configuration interface as @datadog/browser-logs. See the datadog initialization parameters for more details.

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.