Skip to content

Commit

Permalink
Adding LogDNA Winston Transport (#1610)
Browse files Browse the repository at this point in the history
* Adding LogDNA Winston Transport

* No Need for Semicolons

* Update LogDNA transports text

Tightened example code to more relevant bits and removed non-technical text
  • Loading branch information
smusali authored and DABH committed Mar 19, 2019
1 parent 80d3439 commit 8f4cddc
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ there are additional transports written by
* [FastFileRotate](#fastfilerotate-transport)
* [Google Stackdriver Logging](#google-stackdriver-transport)
* [Graylog2](#graylog2-transport)
* [LogDNA](#logdna-transport)
* [Logsene](#logsene-transport) (including Log-Alerts and Anomaly Detection)
* [Logz.io](#logzio-transport)
* [Mail](#mail-transport)
Expand Down Expand Up @@ -462,6 +463,35 @@ const logger = winston.createLogger({
})
```
### LogDNA Transport
[LogDNA Winston][37] is a transport for being able to forward the logs to [LogDNA](https://logdna.com/):
``` js
const logdnaWinston = require('logdna-winston');
const winston = require('winston');
const logger = winston.createLogger({});
const options = {
key: apikey, // the only field required
hostname: myHostname,
ip: ipAddress,
mac: macAddress,
app: appName,
env: envName,
index_meta: true // Defaults to false, when true ensures meta object will be searchable
};

// Only add this line in order to track exceptions
options.handleExceptions = true;

logger.add(new logdnaWinston(options));

let meta = {
data:'Some information'
};
logger.log('info', 'Log from LogDNA Winston', meta);
```
### Logzio Transport
You can download the logzio transport here : [https://github.com/logzio/winston-logzio](https://github.com/logzio/winston-logzio)
Expand Down Expand Up @@ -767,3 +797,4 @@ That's why we say it's a logger for just about everything
[34]: https://github.com/hakanostrom/winston-cloudant
[35]: https://github.com/SerayaEryn/fast-file-rotate
[36]: https://github.com/inspiredjw/winston-dynamodb
[37]: https://github.com/logdna/logdna-winston

0 comments on commit 8f4cddc

Please sign in to comment.