Skip to content

vitaliy-orlov/winston-slack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

winston-slack

A Slack transport for winston

Installation

npm install winston
npm install winston-slack-light

Usage

var winston = require('winston');
require('winston-slack').Slack;
var transport = new winston.transports.Slack({
    token: '<api token>',
    chatId: '<channel or user slack id>'
});
var logger = new winston.Logger({ transports: [transport] });

Options:

  • chatId: Channel or user ID
  • token: Your private API Slack token
  • asUser: Send message as user. By default, message send as bot user. Info
  • 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.

Releases

No releases published

Packages

No packages published