# 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 web api docs)[https://slack.dev/node-slack-sdk/web-api])options.channel_id
-string
- the channel to send log messagesoptions.icon_url
-string
(optional) - the icon to use for the messageoptions.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: "xoxb-xxxx-xxxx-xxxx",
channel_id: "prod-alerts",
username: "our_application"
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Other topics
- Console Appender
- File Appender
- Date Rolling File Appender
- Connect Appender
- Standard Out Appender
- Standard Error Appender
- Insight Appender
- LogEntries Appender
- LogStash HTTP Appender
- LogStash UDP Appender
- Loggly Appender
- RabbitMQ Appender
- Seq Appender
- Slack Appender
- SMTP Appender
- Basic layout
- Colored layout
- Dummy layout
- Message Pass-Through layout
- Object layout
- Json layout
- Pattern layout