michal-palus1/central-logger
最新稳定版本:1.0.1
Composer 安装命令:
composer require michal-palus1/central-logger
包简介
Centralized Laravel log and exception sender for Laravel 9, 10, 11 and 12 projects.
README 文档
README
Laravel 9, 10, 11 and 12 compatible centralized logger.
Install
composer require michal-palus1/central-logger
Publish config
php artisan vendor:publish --tag=central-logger-config
.env
CENTRAL_LOGGER_ENABLED=true
CENTRAL_LOGGER_ENDPOINT=https://logs.techweb.sk/handle
CENTRAL_LOGGER_PROJECT_KEY=some-secret-project-key
CENTRAL_LOGGER_PROJECT_NAME="Project Name"
CENTRAL_LOGGER_ENVIRONMENT=production
config/logging.php
Add channel:
'central' => [
'driver' => 'monolog',
'handler' => \TechWeb\CentralLogger\Logging\CentralLoggerHandler::class,
'level' => 'error',
],
Add to stack:
'stack' => [
'driver' => 'stack',
'channels' => ['single', 'central'],
'ignore_exceptions' => false,
],
Test
logger()->error('Central logger test', [
'foo' => 'bar',
]);
Or:
try {
throw new RuntimeException('Test exception');
} catch (Throwable $e) {
report($e);
}
Compatibility
This version supports:
- Laravel 9 with Monolog 2
- Laravel 10, 11, 12 with Monolog 3
The handler intentionally does not type-hint write() because Monolog 2 passes array records and Monolog 3 passes LogRecord objects.
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-04-27