2.7.0 • Published 4 months 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@2
Looking 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:
token
The Telegram bot authentication token. requiredchatId
The Telegram chatid you want to send to. requiredmessageThreadId
The Telegram unique identifier of a message thread to which the message belongs. optionalparseMode
The Telegram mode for parsing entities in the message text. See formatting options for more details. optionallevel
Level of messages that this transport should log. optional default infounique
Whether to log only the declared level and none above. boolean optionalsilent
Whether to suppress output. boolean optionaldisableNotification
Sends the message silently. boolean optionaltemplate
Format output message. string optionalformatMessage
Format output message by own method. function optionalhandleExceptions
Handle uncaught exceptions. boolean optionalbatchingDelay
Time in ms within which to batch messages together. integer optional default 0 or disabledbatchingSeparator
String 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 messages
Examples
Follow below steps to run the examples:
$ git clone git@github.com:ivanmarban/winston-telegram.git -b master --single-branch
$ npm install
Replace TELEGRAM_TOKEN
and CHAT_ID
with appropiate values, then run whatever example you want:
$ node examples/default-logger.js
2.7.0
4 months ago
2.6.0
2 years ago
2.5.0
2 years ago
2.4.1
3 years ago
2.4.0
3 years ago
2.3.5
3 years ago
2.3.4
3 years ago
2.3.3
3 years ago
2.3.2
3 years ago
2.3.1
3 years ago
2.3.0
4 years ago
1.4.2
4 years ago
2.2.2
4 years ago
2.2.1
4 years ago
2.2.0
5 years ago
1.4.1
5 years ago
2.1.0
5 years ago
1.4.0
5 years ago
1.3.2
5 years ago
2.0.1
5 years ago
2.0.0
5 years ago
1.3.1
5 years ago
1.3.0
6 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago
0.4.0
8 years ago
0.3.0
8 years ago
0.2.1
8 years ago
0.2.0
8 years ago
0.1.0
8 years ago