Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vitaliy-orlov/winston-slack
A Slack transport for winston
https://github.com/vitaliy-orlov/winston-slack
javascript nodejs-modules slack winston
Last synced: 16 days ago
JSON representation
A Slack transport for winston
- Host: GitHub
- URL: https://github.com/vitaliy-orlov/winston-slack
- Owner: vitaliy-orlov
- License: mit
- Created: 2016-03-13T13:47:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-17T14:03:03.000Z (almost 9 years ago)
- Last Synced: 2024-12-12T11:10:24.937Z (about 2 months ago)
- Topics: javascript, nodejs-modules, slack, winston
- Language: JavaScript
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# winston-slack
A Slack transport for [winston](https://github.com/winstonjs/winston)
# Installation
```
npm install winston
npm install winston-slack-light
```
# Usage
``` js
var winston = require('winston');
require('winston-slack').Slack;
var transport = new winston.transports.Slack({
token: '',
chatId: ''
});
var logger = new winston.Logger({ transports: [transport] });
```
Options:
* __chatId:__ Channel or user ID
* __token:__ Your private API Slack [token](https://get.slack.help/hc/en-us/articles/215770388-Creating-and-regenerating-API-tokens)
* __asUser:__ Send message as user. By default, message send as bot user. [Info](https://api.slack.com/methods/chat.postMessage#authorship)
* __asAttachment:__ Send message with body as attachment. It gives you ability to use colors for any log level.
* __attachmentTitle:__ Set text for message. This text will be show in push notification. By default, log level.
* __colors:__ Set your own colors for log levels. Properties: debug, verbose, info, warn, error.