discord-baymax-bot/node_modules/log4js/examples/slack-appender.js

25 lines
602 B
JavaScript
Raw Normal View History

2017-03-24 04:52:08 +00:00
//Note that slack appender needs slack-node package to work.
var log4js = require('../lib/log4js');
log4js.configure({
"appenders": [
{
"type" : "slack",
"token": 'TOKEN',
"channel_id": "#CHANNEL",
"username": "USERNAME",
"format": "text",
"category" : "slack",
"icon_url" : "ICON_URL"
}
]
});
var logger = log4js.getLogger("slack");
logger.warn("Test Warn message");
logger.info("Test Info message");
logger.debug("Test Debug Message");
logger.trace("Test Trace Message");
logger.fatal("Test Fatal Message");
logger.error("Test Error Message");