🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@marfle/winston-transport-datadog

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@marfle/winston-transport-datadog

Datadog logging transport for winston

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
3
Created
Source

winston-transport-datadog

npm (scoped) node (scoped)

winston transport for Datadog logging.

There are couple of winston transports for datadog. This one does buffering, error handling and uses tls-tcp instead of https.

Install

npm install @marfle/winston-transport-datadog

Usage

Use:

const { createLogger } = require('winston');
const { DatadogTransport } = require('@marfle/winston-transport-datadog');

logger = createLogger({
  transports: [
    new DatadogTransport({
      apiKey: '<YOUR API KEY',
      // optional metadata which will be merged with log message
      metadata: {
        environment: process.env.NODE_ENV,
        service: 'myService'
      }
    })
  ]
});

Options

NameDefaultDescription
apiKeyundefinedapi key from datadog
host'intake.logs.datadoghq.com'intake hostname
port10516intake port
bufferSize10000how many messages to buffer before discarding
reconnectInterval10000
socketOptions{ timeout: 10000 }options passed to tls.socket
metadata{ ddsource: 'winston' }optional metadata which will be merged with log message

DatadogTransport extends Transport from winston-transport, so it's options also apply.

License

MIT See LICENSE file.

About us

Marfle makes software for workboat fleets

Keywords

winston

FAQs

Package last updated on 07 Feb 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