2.7.0 • Published 2 years ago
winston-telegram v2.7.0
winston-telegram
A Telegram transport for winston.
winston-telegram@2
Installation:
$ npm install winston@3
$ npm install winston-telegram@2Looking for winston-telegram@1.x ?
Documentation below is for winston-telegram@2. Read the winston-telegram@1.x documentation.
Usage
const logger = require('winston')
const TelegramLogger = require('winston-telegram')
// or
import TelegramLogger from 'winston-telegram';
logger.add(new TelegramLogger(options))Options:
tokenThe Telegram bot authentication token. requiredchatIdThe Telegram chatid you want to send to. requiredmessageThreadIdThe Telegram unique identifier of a message thread to which the message belongs. optionalparseModeThe Telegram mode for parsing entities in the message text. See formatting options for more details. optionallevelLevel of messages that this transport should log. optional default infouniqueWhether to log only the declared level and none above. boolean optionalsilentWhether to suppress output. boolean optionaldisableNotificationSends the message silently. boolean optionaltemplateFormat output message. string optionalformatMessageFormat output message by own method. function optionalhandleExceptionsHandle uncaught exceptions. boolean optionalbatchingDelayTime in ms within which to batch messages together. integer optional default 0 or disabledbatchingSeparatorString with which to join batched messages with string default "\n\n"
String template is based on named arguments:
'{level}' -> level of messages
'{message}' -> text of messages
'{metadata}' -> metadata object of messagesExamples
Follow below steps to run the examples:
$ git clone git@github.com:ivanmarban/winston-telegram.git -b master --single-branch
$ npm installReplace TELEGRAM_TOKEN and CHAT_ID with appropiate values, then run whatever example you want:
$ node examples/default-logger.js2.7.0
2 years ago
2.6.0
3 years ago
2.5.0
4 years ago
2.4.1
4 years ago
2.4.0
4 years ago
2.3.5
4 years ago
2.3.4
5 years ago
2.3.3
5 years ago
2.3.2
5 years ago
2.3.1
5 years ago
2.3.0
5 years ago
1.4.2
6 years ago
2.2.2
6 years ago
2.2.1
6 years ago
2.2.0
6 years ago
1.4.1
6 years ago
2.1.0
6 years ago
1.4.0
6 years ago
1.3.2
6 years ago
2.0.1
6 years ago
2.0.0
7 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.0
8 years ago
1.0.0
9 years ago
0.4.0
9 years ago
0.3.0
9 years ago
0.2.1
10 years ago
0.2.0
10 years ago
0.1.0
10 years ago
