winston-transport-mattermost

    1.0.4 • Public • Published

    winston-transport-mattermost

    A Winston @3.x transport for Mattermost.

    NPM

    Install

    npm install winston-transport-mattermost

    Usage

    const winston = require('winston')
    const MattermostTransport = require('winston-transport-mattermost')
     
    const logger = winston.createLogger({
      transports: [
        new MattermostTransport({
          level: 'error',
          webhook_url: 'https://your.mattermost.com/hooks/334ktjodu7gq5yq7afj3w',
          username: 'logger name',
          icon_url: 'https://example.com/icon.png'
        })
      ]
    })
     
    logger.error('Something happened!')
     

    Config

    • webhook_url: (Required) Mattermost Incoming Webhook URL.
    • username: (Default Winston) Who sends the message.
    • icon_url: (Default Adorable avatars) Public image URL for user avatar.

    Screenshots

    Motivation

    The other mattermost transport packages have too many dependencies and are not compatible with Winston @3.X, and don't allow to customize the name or avatar of the message.

    License

    MIT

    Install

    npm i winston-transport-mattermost

    DownloadsWeekly Downloads

    1

    Version

    1.0.4

    License

    MIT

    Unpacked Size

    4.68 kB

    Total Files

    4

    Last publish

    Collaborators

    • gmoqa