Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/log4js-node/slack
Slack Appender for log4js-node
https://github.com/log4js-node/slack
Last synced: 2 months ago
JSON representation
Slack Appender for log4js-node
- Host: GitHub
- URL: https://github.com/log4js-node/slack
- Owner: log4js-node
- License: apache-2.0
- Created: 2018-06-11T21:45:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-20T07:07:04.000Z (over 1 year ago)
- Last Synced: 2024-09-19T19:51:00.787Z (4 months ago)
- Language: JavaScript
- Size: 711 KB
- Stars: 8
- Watchers: 4
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Slack Appender for log4js-node
Sends log events to a [slack](https://slack.com) channel. This is an optional appender for use with [log4js](https://log4js-node.github.io/log4js-node/).
```bash
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](layouts.md)).## Example
```javascript
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`.