定制 posapp-vn/laravel-lark-logging 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

posapp-vn/laravel-lark-logging

最新稳定版本:v1.0.0

Composer 安装命令:

composer require posapp-vn/laravel-lark-logging

包简介

A Laravel package for logging to Lark bot

README 文档

README

Send logs to Lark chat via Lark bot

Install

composer require posapp-vn/laravel-lark-logging

Define Lark Bot Webhook URL in your .env file

LARK_WEBHOOK_URL=https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-id-xxxxxx>

Add to config/logging.php file new channel:

'lark' => [
    'driver' => 'custom',
    'via'    => PosAppVN\LarkLogger\LarkLogger::class,
    'level'  => 'debug',
    'title' => env('APP_NAME', 'Laravel Log'), // optional - title of the message
    'retries' => 3, // optional - retry sending message 3 times
]

Publish config file

php artisan vendor:publish --provider "PosAppVN\LarkLogger\LarkLoggerServiceProvider"

Create bot

For using this package you need to create Lark bot: https://open.larksuite.com/document/client-docs/bot-v3/add-custom-bot

Configuring a different chat id or token per channel

  1. Add webhook_url or title to channels in config/logging.php.
[
    'channels' => [

        'lark-log' => [
            'driver' => 'custom',
            'via'    => PosAppVN\LarkLogger\LarkLogger::class,
            'level'  => 'debug',
            'webhook_url' => 'https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-id-xxxxxx>',
            'title' => 'Laravel Log',
        ],
        
        'lark-system' => [
            'driver' => 'custom',
            'via'    => PosAppVN\LarkLogger\LarkLogger::class,
            'level'  => 'error',
            'webhook_url' => 'https://open.feishu.cn/open-apis/bot/v2/hook/<your-hook-id-xxxxxx>',
            'title' => 'System Log',
        ],

    ]
]

统计信息

  • 总下载量: 570
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-12-27