michal-palus1 / central-logger
Centralized Laravel log and exception sender for Laravel 9, 10, 11 and 12 projects.
Package info
gitlab.com/michal-palus1/techweb-central-logger
pkg:composer/michal-palus1/central-logger
1.0.1
2026-04-27 15:02 UTC
Requires
- php: ^8.0|^8.1|^8.2|^8.3|^8.4
- illuminate/http: ^9.0|^10.0|^11.0|^12.0
- illuminate/support: ^9.0|^10.0|^11.0|^12.0
- monolog/monolog: ^2.0|^3.0
This package is not auto-updated.
Last update: 2026-04-28 17:04:12 UTC
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.