michal-palus1/central-logger

Centralized Laravel log and exception sender for Laravel 9, 10, 11 and 12 projects.

Maintainers

Package info

gitlab.com/michal-palus1/techweb-central-logger

Issues

pkg:composer/michal-palus1/central-logger

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

1.0.1 2026-04-27 15:02 UTC

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.