dickyermawan / yii2-telegram-log
Yii2 telegram log to sends logs in Yii2 to telegram.
Installs: 9
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: ~2.0.0
- yiisoft/yii2-httpclient: ~2.0
This package is auto-updated.
Last update: 2025-03-22 00:42:55 UTC
README
Yii2 telegram log to sends log in Yii2 to telegram.
Installation
The preferred way to install this extension is through composer.
Either run
composer require dickyermawan/yii2-telegram-log
or add
"dickyermawan/yii2-telegram-log": "*"
to the require section of your composer.json
file.
How To Use
You should set telegram bot token and chatId in your config file. You can use the @get_id_bot bot to obtain it. It should look like 123456789.
'componenst' => [
'log' => [
'targets' => [
[
'class' => 'dickyermawan\log\Telegram',
'levels' => ['error'],
'botToken' => '123456:abcde', // bot token secret key
'chatId' => '123456', // chat id or channel username with @ like 12345 or @channel
'appName' => 'YOUR APP NAME', // optional (default is \Yii::$app->name)
],
],
],
]