From cc9f4da121c6283714a5e9173d6d21368b79c8a5 Mon Sep 17 00:00:00 2001 From: Nikhil Fadnis Date: Thu, 6 Jun 2019 14:44:22 +0530 Subject: [PATCH] Add datadog winston transport --- docs/transports.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/transports.md b/docs/transports.md index 562737950..33045661b 100644 --- a/docs/transports.md +++ b/docs/transports.md @@ -37,6 +37,7 @@ there are additional transports written by * [Cassandra](#cassandra-transport) * [Cisco Spark](#cisco-spark-transport) * [Cloudant](#cloudant) + * [Datadog](#datadog-winston) * [Elasticsearch](#elasticsearch-transport) * [FastFileRotate](#fastfilerotate-transport) * [Google Stackdriver Logging](#google-stackdriver-transport) @@ -402,6 +403,36 @@ The Cloudant transport takes the following options: db : Name of the databasename to put logs in logstash : Write logs in logstash format +### Datadog Transport +[datadog-winston][38] is a transport to ship your logs to datadog. + +```javascript +var winston = require('winston') +var DatadogWinston = require('datadog-winston') + +var logger = winston.createLogger({ + // Whatever options you need + // Refer https://github.com/winstonjs/winston#creating-your-own-logger +}) + +logger.add( + new DatadogWinston({ + apiKey: 'super_secret_datadog_api_key', + hostname: 'my_machine', + service: 'super_service', + ddsource: 'node.js', + ddtags: 'foo:bar,boo:baz' + }) +) +``` + +Options: +* __apiKey__: Your datadog api key *[required]* +* __hostname__: The machine/server hostname +* __service__: The name of the application or service generating the logs +* __ddsource__: The technology from which the logs originated +* __ddtags__: Metadata assoicated with the logs + ### Google Stackdriver Transport [@google-cloud/logging-winston][29] provides a transport to relay your log messages to [Stackdriver Logging][30]. @@ -798,3 +829,4 @@ That's why we say it's a logger for just about everything [35]: https://github.com/SerayaEryn/fast-file-rotate [36]: https://github.com/inspiredjw/winston-dynamodb [37]: https://github.com/logdna/logdna-winston +[38]: https://github.com/itsfadnis/datadog-winston