kiriminaja/laravel-telegram-log
Composer 安装命令:
composer require kiriminaja/laravel-telegram-log
包简介
Send laravel logs into Telegram Chat via bot
README 文档
README
Laravel Telegram Log
Send logs to Telegram chat via Telegram bot. Inspired by https://github.com/grkamil/laravel-telegram-logging
Documentation · Contact Us · Fun IG Account · Blog
Requirement
- PHP 8.0 above
- Laravel 8 or higher
Install
composer require kiriminaja/laravel-telegram-log
Configurations
Please define Telegram Bot Credentials and chat id as environment parameters by modifying .env on your project path
TELEGRAM_BOT_TOKEN=null TELEGRAM_CHAT_ID=null TELEGRAM_LOGGER_TEMPLATE=null TELEGRAM_OPTIONS=[]
Create new logging channel by modifying config/logging.php file
'telegram' => [ 'driver' => 'custom', 'via' => TelegramLog\TelegramLogger::class, 'level' => 'debug', ]
Or if your default log channel is a stack, you can add it to the stack channel like this
'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'telegram'], ]
By default LOG_CHANNEL will be set into stack so you need to set default logger on env after setting up configurations above
LOG_CHANNEL=telegram
Publish config file and views to override
php artisan vendor:publish --provider "TelegramLog\TelegramServiceProvider"
Create bot
For using this plugin, 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
Change log template at runtime
- Change config for template.
config(['telegram-logger.template'=>'laravel-telegram-logging::custom'])
- Use
Logas usual
kiriminaja/laravel-telegram-log 适用场景与选型建议
kiriminaja/laravel-telegram-log 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.95k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 12 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kiriminaja/laravel-telegram-log 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kiriminaja/laravel-telegram-log 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.95k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-21
