Home

Awesome

Slack Appender for log4js-node

Sends log events to a slack channel. This is an optional appender for use with log4js.

npm install @log4js-node/slack

Configuration

Example

log4js.configure({
  appenders: {
    alerts: {
      type: '@log4js-node/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.