forked from rosshettel/placegoat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlogger.js
24 lines (23 loc) · 767 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var winston = require('winston'),
slackWinston = require('slack-winston'),
slackWebhook = process.env.LOGGING_WEBHOOK || 'n/a',
logger = new (winston.Logger)({
transports: [
new winston.transports.Console({
level: 'debug',
colorize: true,
prettyPrint: true,
timestamp: function () {
return new Date().toLocaleString();
}
}),
new slackWinston.Slack({
domain: 'rosshettel',
webhook_url: slackWebhook,
channel: 'placegoat-logs',
silent: slackWebhook === 'n/a',
level: 'debug'
})
]
});
module.exports = logger;