Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

winston-discord-transport

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

winston-discord-transport

A Discord transport for winston logger

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
283
decreased by-50.95%
Maintainers
1
Weekly downloads
 
Created
Source
Dependency Status devDependency Status Build Status Known Vulnerabilities

Winston Discord Transport

A custom winston transport for Discord.

This library serves as a Transport for winston, a popular Nodejs logging library.

Features

  1. Sends complete error stack to discord (see screenshot below)
  2. Color codes messages based on log level. Errors are red!
  3. Includes information about host machine to pin point source of message.
  4. Add any other meta data you want to see in Discord.

Installation

$ npm i winston-discord-transport

Usage

Add as a transport
import winston from 'winston';
import DiscordTransport from 'winston-discord-transport';

const logger = winston.createLogger({
  transports: [
    new DiscordTransport({
      webhook: 'https:/your/discord/webhook',
      defaultMeta: { service: 'my_node_service' },
      level: 'warn'
    })
  ],
});

logger.log({
  level: 'error',
  message: 'Error intializing service',
  meta: {
    additionalKey: 'someValue'
  },
  error: new Error()
});
Selectively skip a particular message from being sent to Discord

There might be some log messages which you might want to raise to a file or console, but not flood your Discord channel. For such message, just include discord: false as a key-value in the log message and the transport will drop the message from being sent to Discord.

logger.log({
  level: 'warn',
  message: 'Some warning message to not send to discord',
  discord: false
});
Screenshots
Error message
Error message screenshot
Warning message
Warning message screenshot
Info message
Info message screenshot
Verbose message
Verbose message screenshot
Debug message
Debug message screenshot
Silly message
Silly message screenshot

Keywords

FAQs

Package last updated on 08 May 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc