# Slack Appender

Sends log events to a slack (opens new window) channel.

npm install --save @tsed/logger-slack
1

# Configuration

  • type - slack
  • options.token - string - your Slack API token (see the slack and slack-node docs)
  • options.channel_id - string - the channel to send log messages
  • options.icon_url - string (optional) - the icon to use for the message
  • options.username - string - the username to display with the message

# Example

import {Logger} from "@tsed/logger";
import "@tsed/logger-slack";

const logger = new Logger("loggerName");

logger.appenders.set("stdout", {
  type: "slack",
  level: ["error"],
  options: {
    token: "abc123def",
    channel_id: "prod-alerts",
    username: "our_application"
  }
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Last Updated: 4/2/2021, 4:31:14 PM

Other topics