You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adding LogDNA Winston Transport
* No Need for Semicolons
* Update LogDNA transports text
Tightened example code to more relevant bits and removed non-technical text
[LogDNA Winston][37] is a transport for being able to forward the logs to [LogDNA](https://logdna.com/):
469
+
470
+
``` js
471
+
constlogdnaWinston=require('logdna-winston');
472
+
constwinston=require('winston');
473
+
constlogger=winston.createLogger({});
474
+
constoptions= {
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(newlogdnaWinston(options));
488
+
489
+
let meta = {
490
+
data:'Some information'
491
+
};
492
+
logger.log('info', 'Log from LogDNA Winston', meta);
493
+
```
494
+
465
495
### Logzio Transport
466
496
467
497
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
0 commit comments