Skip to content

Commit

Permalink
Add datadog winston transport (#1656)
Browse files Browse the repository at this point in the history
  • Loading branch information
itsfadnis authored and DABH committed Jun 29, 2019
1 parent 05bed4d commit bf2b986
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions docs/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ there are additional transports written by
* [Cassandra](#cassandra-transport)
* [Cisco Spark](#cisco-spark-transport)
* [Cloudant](#cloudant)
* [Datadog](#datadog-transport)
* [Elasticsearch](#elasticsearch-transport)
* [FastFileRotate](#fastfilerotate-transport)
* [Google Stackdriver Logging](#google-stackdriver-transport)
Expand Down Expand Up @@ -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].
Expand Down Expand Up @@ -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

0 comments on commit bf2b986

Please sign in to comment.