updated slack config file

This commit is contained in:
bill bittner 2017-12-08 10:25:05 -08:00
parent 6ae9b78dbf
commit c680a6efa3

View file

@ -4,6 +4,7 @@ const winstonSlackWebHook = require('winston-slack-webhook').SlackWebHook;
module.exports = (winston) => {
if (config.logging.slackWebHook) {
// add a transport for errors to slack
if (config.logging.slackErrorChannel) {
winston.add(winstonSlackWebHook, {
name : 'slack-errors-transport',
level : 'warn',
@ -12,6 +13,8 @@ module.exports = (winston) => {
username : 'spee.ch',
iconEmoji : ':face_with_head_bandage:',
});
};
if (config.logging.slackInfoChannel) {
winston.add(winstonSlackWebHook, {
name : 'slack-info-transport',
level : 'info',
@ -20,11 +23,11 @@ module.exports = (winston) => {
username : 'spee.ch',
iconEmoji : ':nerd_face:',
});
};
// send test message
winston.error('Slack "error" logging is online.');
winston.warn('Slack "warning" logging is online.');
winston.info('Slack "info" logging is online.');
} else {
winston.warn('Slack logging is not enabled because no SLACK_WEB_HOOK env var provided.');
winston.warn('Slack logging is not enabled because no slackWebHook config var provided.');
}
};