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 Webhook
5
//
6
//
7
// The Console transport will simply output to the console screen
8
// The Webhook tranports will perform an HTTP POST request to an abritrary end-point ( for post/recieve webhooks )
9
//
10
var logger = new (winston.Logger)({
11
transports: [
12
new (winston.transports.Console)(),
13
new (winston.transports.Webhook)({ 'host': 'localhost', 'port': 8080, 'path': '/collectdata' })
14
]
15
});
16
17
logger.log('info', 'Hello webhook log files!', { 'foo': 'bar' });
18
19