log4js-node

A port of log4js to node.js

View the Project on GitHub

Slack Appender

Sends log events to a slack channel. To use this appender you will need to include slack-node in your application’s dependencies.

Configuration

Example

log4js.configure({
  appenders: {
    alerts: {
      type: 'slack',
      token: 'abc123def',
      channel_id: 'prod-alerts',
      username: 'our_application'
    }
  },
  categories: {
    default: { appenders: ['alerts'], level: 'error' }
  }
});

This configuration will send all error (and above) messages to the prod-alerts slack channel, with the username our_application.