haokaiyang / laravel-feishu-logging
Send logs to Feishu group via Feishu Custom bot
Requires
- php: ^7.1.3
- ext-json: *
- guzzlehttp/guzzle: ^6
- laravel/framework: ^5.6|^6.0|^7.0
- monolog/monolog: ^1.23|^2.0
This package is auto-updated.
Last update: 2024-05-12 21:42:42 UTC
README
Send logs to Feishu group via Feishu Custom bot
Install
composer require haokaiyang/laravel-feishu-logging
Document: 机器人 | 如何在群聊中使用机器人?
Define feishu custom bot Token and set as environment parameters. Add to your environment file
token is a part of Feishu Webhook url
if your Webhook is (https://open.feishu.cn/open-apis/bot/hook/xxxxxxxxxxxxxxxxxxxxxxxxxxx)
token is 'xxxxxxxxxxxxxxxxxxxxxxxxxxx'
FEISHU_LOGGER_BOT_TOKEN=token
Add to config/logging.php file new channel: if you want to setting different feishu custom bot,you can define token into channel setting
'feishu' => [ 'driver' => 'custom', 'via' => Logger\FeishuLogger::class, 'level' => 'debug', 'token' => env('FEISHU_LOGGER_BOT_TOKEN', 'YOUR-CUSTOM-BOT-TOKEN'), ]
If your default log channel is a stack, you can add it to the stack channel like this
'stack' => [ 'driver' => 'stack', 'channels' => ['single', 'feishu'], ]
Or you can simply change the default log channel in the .env
LOG_CHANNEL=feishu
Publish config file
php artisan vendor:publish --provider "Logger\FeishuLoggerServiceProvider"