Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Avatar for KuCalc : devops.
Download
50659 views
1
var winston = require('../lib/winston');
2
3
//
4
// Create a new winston logger instance with two tranports: Console, and Couchdb
5
//
6
//
7
// The Console transport will simply output to the console screen
8
// The Couchdb tranport will perform an HTTP POST request to the specified CouchDB instance
9
//
10
var logger = new (winston.Logger)({
11
transports: [
12
new (winston.transports.Console)(),
13
new (winston.transports.Couchdb)({ 'host': 'localhost', 'db': 'logs' })
14
// if you need auth do this: new (winston.transports.Couchdb)({ 'user': 'admin', 'pass': 'admin', 'host': 'localhost', 'db': 'logs' })
15
]
16
});
17
18
logger.log('info', 'Hello webhook log files!', { 'foo': 'bar' });
19
20