hmoreira10/logsnag-logger
Composer 安装命令:
composer require hmoreira10/logsnag-logger
包简介
Canal de log personalizado do Laravel para envio ao LogSnag via HTTP
README 文档
README
A custom Laravel logging channel that sends logs directly to the LogSnag API via HTTP using Monolog.
Description
This package provides an easy way to integrate Laravel's logging system with LogSnag, allowing you to send structured log events directly to your LogSnag project. It leverages Monolog's custom handlers and Laravel's logging channels for seamless integration.
Installation
Install the package via Composer:
composer require hmoreira10/logsnag-logger:dev-main
Configuration
Add the custom log channel to your config/logging.php file:
'channels' => [ // other channels... 'logsnag-your-channel' => [ 'driver' => 'custom', 'via' => LogSnag\Logger\LogSnagLogger::class, 'level' => 'info', 'token' => env('LOGSNAG_TOKEN'), 'project' => env('LOGSNAG_PROJECT'), 'channel' => 'your-channel' ], ],
Then add the required environment variables to your .env file:
LOGSNAG_TOKEN=your-logsnag-api-token LOGSNAG_PROJECT=your-logsnag-project
Usage
Use the custom log channel in your Laravel application like this:
use Illuminate\Support\Facades\Log; Log::channel('logsnag')->info('Important event happened', [ 'notify' => false 'icon' => '💰', ]);
Notes
- Logs are sent synchronously.
- Customize
notify,channel, andiconvia context. - Requires Laravel 10+ and PHP 8.1+.
License
MIT License
统计信息
- 总下载量: 300
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-05-21