ycanga/central-logger
最新稳定版本:v1.1.1
Composer 安装命令:
composer require ycanga/central-logger
包简介
Centralized logging package for Laravel
README 文档
README
A simple Laravel logging driver that sends logs to a central server.
🚀 Installation
- Install the package via Composer
composer require ycanga/central-logger
- Publish the configuration file
php artisan vendor:publish --provider="ycanga\CentralLogger\CentralLoggerServiceProvider" --tag="config"
⚙️ Configuration
- Add the following environment variables to your .env file:
LOG_CHANNEL=central_logger LOG_ENDPOINT=[YOUR-CENTRAL-LOGGER-SERVER-ENDPOINT]/api/log LOG_API_KEY=[YOUR-PROJECT-API-KEY]
- Register the logging channel in config/logging.php:
'channels' => [ // Other channels... 'central_logger' => [ 'driver' => 'central_logger', ], ],
📤 Usage
Once configured, Laravel will send all log messages to your central logger server via the central_logger channel.
You can also log manually using the channel:
Log::channel('central_logger')->info('This is a test log from my project.');
Developed with ❤️ by ycanga
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-06