LaravelPackages.net
Acme Inc.
Toggle sidebar
haokaiyang/laravel-feishu-logging

Send logs to Feishu group via Feishu Custom bot

8
2
0.1.0
About haokaiyang/laravel-feishu-logging

haokaiyang/laravel-feishu-logging is a Laravel package for send logs to feishu group via feishu custom bot. It currently has 2 GitHub stars and 8 downloads on Packagist (latest version 0.1.0). Install it with composer require haokaiyang/laravel-feishu-logging. Discover more Laravel packages by haokaiyang or browse all Laravel packages to compare alternatives.

Last updated

Laravel Feishu logger

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"

Star History Chart