New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

posapp-vn/laravel-lark-logging

A Laravel package for logging to Lark bot
1,636 3
Install
composer require posapp-vn/laravel-lark-logging
Latest Version:v1.0.0
PHP:>=8.2
Laravel:8 – 11
License:MIT
Last Updated:Feb 4, 2025
Links: GitHub  ·  Packagist
Maintainer: posapp-developer

Laravel Lark logger

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',
        ],

    ]
]

Related Packages

devtime-ltd/laravel-axiom-log

Batched Monolog handler for Axiom in Laravel.

6,075 0
anthonyedmonds/laravel-database-log

Store your Laravel logs in the database

5,977 1
naoray/laravel-github-monolog

Log driver to store logs as github issues

29,492 108
denoby/laravel-telegram-logger

Laravel package for sending logs and messages to Telegram

1,544 1
alitvinenko/laravel-pachka-logging

Send Laravel logs to Pachka messenger via webhook

1,227 0

Version History

Version Released PHP Laravel License
v1.0.0 >=8.2 ^8.0|^9.0|^10.0|^11.0 MIT