@marfle/winston-transport-datadog
Datadog logging transport for winston
Last updated 4 months ago by anajavi .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @marfle/winston-transport-datadog 
SYNC missed versions from official npm registry.

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

Name Default Description
apiKey undefined api key from datadog
host 'intake.logs.datadoghq.com' intake hostname
port 10516 intake port
bufferSize 10000 how many messages to buffer before discarding
reconnectInterval 10000
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

Current Tags

  • 0.2.0                                ...           latest (4 months ago)

2 Versions

  • 0.2.0                                ...           4 months ago
  • 0.1.0                                ...           8 months ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |