michelmelo/telegram-logger-errors
最新稳定版本:1.1.0
Composer 安装命令:
composer require michelmelo/telegram-logger-errors
包简介
Send logs to Telegram chat via Telegram bot
README 文档
README
Send logs to Telegram chat via Telegram bot
Install
composer require michelmelo/telegram-logger-errors
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' => MichelMelo\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 "MichelMelo\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
/startmessage
统计信息
- 总下载量: 623
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-07-13