@gojob/winston-slack
Based on [wja-no/winston-slack](https://github.com/wja-no/winston-slack). Rewritten in TypeScript.
Last updated a year ago by vinceops .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @gojob/winston-slack 
SYNC missed versions from official npm registry.

Based on wja-no/winston-slack. Rewritten in TypeScript.


Winston Transport for Slack chat integration.

npm install --save @gojob/winston-slack

Basic transport that works just like all other winston transports. Sends logged messages to a specified Slack chat channel.

Configuration options:

  • webhook_url: required The webhook URL, something like https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ
  • level: If specified, this logger will only log messages at the specified level of importance and more important messages
  • custom_formatter: a function (level, msg, meta) which returns a Slack payload object

Additionally, you can specify any Slack message parameters (such as username and channel), and it will be applied as a fallback if the given argument is not specified per message.


var winston = require('winston');
var Slack = require('@gojob/winston-slack');

winston.add(Slack, {
    webhook_url: "https://hooks.slack.com/services/XXXXXXXXX/YYYYYYYYY/ZZZZZZZZZZZZZZZZZZZZZZZZ",
    channel: "#test-channel",
    username: "ErrorBot",
    level: 'error',
    handleExceptions: true
});

Current Tags

  • 0.1.1                                ...           latest (a year ago)

2 Versions

  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (5)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |