Socket
Book a DemoInstallSign in
Socket

@log4js-node/slack

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@log4js-node/slack

Slack Appender for log4js-node

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
828
-44.76%
Maintainers
1
Weekly downloads
 
Created
Source

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

  • type - @log4js-node/slack
  • token - string - your Slack API token (see the slack and slack-node docs)
  • channel_id - string - the channel to send log messages
  • icon_url - string (optional) - the icon to use for the message
  • username - string - the username to display with the message
  • layout - object (optional, defaults to basicLayout) - the layout to use for the message (see layouts).

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.

Keywords

logging

FAQs

Package last updated on 13 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts