Download the PHP package thefx/yii2-telegram-log without Composer
On this page you can find all versions of the php package thefx/yii2-telegram-log. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download thefx/yii2-telegram-log
More information about thefx/yii2-telegram-log
Files in thefx/yii2-telegram-log
Package yii2-telegram-log
Short Description Telegram log target for Yii 2
License MIT
Homepage https://github.com/thefx/yii2-telegram-log
Informations about the package yii2-telegram-log
Telegram log target for Yii 2
Telegram log target for Yii 2.
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
First create a new bot and obtain its token. It should look like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
.
You will also need a chat ID to send logs to. You can use the @get_id_bot
bot to obtain it. It should look like 123456789
.
Then set the following Yii 2 configuration parameters:
Configuration
By default yii\log\Logger
error levels are mapped to emojis (you can tweak them in the levelEmojis
property):
Error level | Emoji |
---|---|
Logger::LEVEL_ERROR |
☠️ |
Logger::LEVEL_WARNING |
⚠️ |
Logger::LEVEL_INFO |
ℹ️ |
Logger::LEVEL_TRACE |
📝 |
It's also possible to disable notifications - entirely or per logger level (look at the enableNotification
property), for example:
This will disable notifications for warning and info level messages and enable them for other levels (honestly, you can omit the LEVEL_ERROR
definition here as it's true
by default).
All versions of yii2-telegram-log with dependencies
yiisoft/yii2-httpclient Version ~2.0.0
sergeymakinen/yii2-log-message Version ^2.0