Skip to content

Commit 8f4cddc

Browse files
smusaliDABH
authored andcommitted
Adding LogDNA Winston Transport (#1610)
* Adding LogDNA Winston Transport * No Need for Semicolons * Update LogDNA transports text Tightened example code to more relevant bits and removed non-technical text
1 parent 80d3439 commit 8f4cddc

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

docs/transports.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ there are additional transports written by
4141
* [FastFileRotate](#fastfilerotate-transport)
4242
* [Google Stackdriver Logging](#google-stackdriver-transport)
4343
* [Graylog2](#graylog2-transport)
44+
* [LogDNA](#logdna-transport)
4445
* [Logsene](#logsene-transport) (including Log-Alerts and Anomaly Detection)
4546
* [Logz.io](#logzio-transport)
4647
* [Mail](#mail-transport)
@@ -462,6 +463,35 @@ const logger = winston.createLogger({
462463
})
463464
```
464465
466+
### LogDNA Transport
467+
468+
[LogDNA Winston][37] is a transport for being able to forward the logs to [LogDNA](https://logdna.com/):
469+
470+
``` js
471+
const logdnaWinston = require('logdna-winston');
472+
const winston = require('winston');
473+
const logger = winston.createLogger({});
474+
const options = {
475+
key: apikey, // the only field required
476+
hostname: myHostname,
477+
ip: ipAddress,
478+
mac: macAddress,
479+
app: appName,
480+
env: envName,
481+
index_meta: true // Defaults to false, when true ensures meta object will be searchable
482+
};
483+
484+
// Only add this line in order to track exceptions
485+
options.handleExceptions = true;
486+
487+
logger.add(new logdnaWinston(options));
488+
489+
let meta = {
490+
data:'Some information'
491+
};
492+
logger.log('info', 'Log from LogDNA Winston', meta);
493+
```
494+
465495
### Logzio Transport
466496
467497
You can download the logzio transport here : [https://github.com/logzio/winston-logzio](https://github.com/logzio/winston-logzio)
@@ -767,3 +797,4 @@ That's why we say it's a logger for just about everything
767797
[34]: https://github.com/hakanostrom/winston-cloudant
768798
[35]: https://github.com/SerayaEryn/fast-file-rotate
769799
[36]: https://github.com/inspiredjw/winston-dynamodb
800+
[37]: https://github.com/logdna/logdna-winston

0 commit comments

Comments
 (0)