taskord / telegram-logger
Send logs to Telegram chat via Telegram bot
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.0.1
2020-08-28 03:06 UTC
Requires
- php: ^7.1.3
- laravel/framework: 5.6.*|5.7.*|5.8.*|^6.0|^7.0
- monolog/monolog: ^1.23|^2.0
This package is auto-updated.
Last update: 2020-09-23 06:47:36 UTC
README
Send logs to Telegram chat via Telegram bot
Install
composer require taskord/telegram-logger
Define Telegram Bot Token and chat id (users telegram id) and set as environment parameters. Add to .env
TELEGRAM_LOGGER_BOT_TOKEN=id:token
TELEGRAM_LOGGER_CHAT_ID=chat_id
Add to config/logging.php file new channel:
'telegram' => [
'driver' => 'custom',
'via' => Logger\TelegramLogger::class,
'level' => 'debug',
]
If your default log channel is a stack, you can add it to the stack channel like this
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'telegram'],
]
Or you can simply change the default log channel in the .env
LOG_CHANNEL=telegram
Publish config file
php artisan vendor:publish --provider "Logger\TelegramLoggerServiceProvider"
Create bot
For using this package you need to create Telegram bot
- Go to @BotFather in the Telegram
- Send
/newbot
- Set up name and bot-name for your bot.
- Get token and add it to your .env file (it is written above)
- Go to your bot and send
/start
message