1.1.6 • Published 5 months ago

@wildegor/winston-telegram v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Winston-Telegram

NPM

A Telegram transport for winston.

Originally forked from ivanmarban/winston-telegram and updated to support winston 3.x and new features.

Version npm npm Downloads Tests Status Coverage Status JavaScript Style Guide

Main features:

  • Send log message to Telegram;
  • Send log messages with batching delay;
  • Send log messages with custom template;
  • Send log messages with custom formatMessage function;
  • Send log messages to specific chat;
  • Send log messages to specific topic;
  • Send log messages with silent mode;
  • Send log messages with disable notification;
  • Send log messages with custom parse mode;
  • Send log messages with custom levels;
  • Send log messages with handle exceptions;
  • Send log messages with custom batching separator.

Installation:

$ yarn add winston@3
$ yarn add winston-transport@4
$ yarn add axios
$ yarn add @wildegor/winston-telegram@latest

Usage

const logger = require('winston')
const TelegramTransport = require('@wildegor/winston-telegram')

// or
import { TelegramTransport } from '@wildegor/winston-telegram';

logger.add(new TelegramTransport(options))

Options:

String template is based on named arguments:

'{level}' -> level of messages
'{message}' -> text of messages
'{metadata}' -> metadata object of messages

Examples

Follow below steps to run the examples:

$ git clone git@github.com:wildegor/winston-telegram.git -b main --single-branch
$ yarn install

Replace TELEGRAM_TOKEN and CHAT_ID with appropriate values, then run whatever example you want:

$ cd examples/simple-log # or examples/replace-nest-logger
$ yarn install
$ yarn start:dev
1.1.6

5 months ago

1.1.5

5 months ago

1.1.4

5 months ago

1.1.3

5 months ago

1.1.2

5 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.0

6 months ago

1.0.0-beta.4

6 months ago

1.0.0-beta.3

6 months ago

1.0.0-beta.2

6 months ago