khairulimran/laravel-log-central

Ship logs and exceptions from a Laravel app to a Log Central server.

Maintainers

Package info

github.com/khairulimran-97/laravel-log-central

pkg:composer/khairulimran/laravel-log-central

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-07-12 09:35 UTC

This package is auto-updated.

Last update: 2026-07-12 09:40:20 UTC


README

Latest Version on Packagist Total Downloads License

Ship logs and exceptions from any Laravel app to your self-hosted Log Central server — zero code changes, three env values.

  • Exceptions, automatically — every reported exception (web, queue, artisan, scheduler, report($e)) is captured and shipped with fingerprint, stack trace, request info, and the authenticated user.
  • Log channels, wrapped — pick channels (or * for all) and their entries stream to the central log viewer while local files keep working as backup.
  • Never blocks your app — everything ships through queued jobs, batched, with capped retries. Shipping failures are silent and can never loop.
  • Scrubbed before sending — passwords, tokens, keys, and card numbers are replaced with [scrubbed] before leaving the app.

Requirements

  • PHP 8.2+, Laravel 11–13
  • A running queue worker (Redis/Horizon recommended)
  • A Log Central server and a project key (Apps page)

Installation

composer require khairulimran/laravel-log-central

Add to .env:

CENTRAL_LOG_URL=https://logs.example.com/api
CENTRAL_LOG_TOKEN=your-project-key
CENTRAL_LOG_APP=your-app-slug
# comma-separated list, or * to ship every channel
CENTRAL_LOG_CHANNELS=payment_callback,webhook

That's it. The service provider auto-registers, hooks exception reporting, and wraps the listed channels.

Configuration

Publish the config to customise scrub keys, the shipping queue, or defaults:

php artisan vendor:publish --tag=log-central-config
Env Default Purpose
CENTRAL_LOG_URL Base API URL of the Log Central server
CENTRAL_LOG_TOKEN The app's project key
CENTRAL_LOG_APP slug of app.name Must match the slug registered on Log Central
CENTRAL_LOG_CHANNELS (empty) Channels to ship; * = all (exceptions ship regardless)
CENTRAL_LOG_QUEUE default queue Queue name for shipping jobs
CENTRAL_LOG_ENABLED true Master switch (set false in testing)

What gets captured

Situation Shipped?
Uncaught exception (web, queue, artisan, scheduler) ✅ as error
report($e) inside try/catch ✅ as error
Log::...() on a shipped channel ✅ as log entry
Log::...() on an unlisted channel ❌ file only
Exception silently swallowed without report()

Testing

composer install
composer test

License

MIT