centralog / error-monitoring-laravel
Laravel SDK for Centralog error monitoring. Captures exceptions and sends a copy to your Centralog platform without breaking your app.
v0.1.0
2026-09-30 18:31 UTC
Requires
- php: ^8.2
- illuminate/support: ^11.0|^12.0|^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.0
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^3.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel SDK for Centralog error monitoring. Captures exceptions and sends a copy to your Centralog platform. Never breaks your app.
Install
composer require centralog/error-monitoring-laravel
Publish the config:
php artisan vendor:publish --provider="Centralog\ErrorMonitoring\CentralogServiceProvider" --tag="centralog-config"
Configure
.env:
CENTRALOG_ENABLED=true CENTRALOG_ENDPOINT=https://centralog.tudominio.com/api/v1/ingest/events CENTRALOG_API_KEY=clk_tu_api_key CENTRALOG_ENVIRONMENT=production CENTRALOG_RELEASE=2026.09.30.1 CENTRALOG_TIMEOUT=2
Generate the API key in Centralog: Projects → API Keys.
Usage
Report exceptions from your exception handler (bootstrap/app.php):
use Centralog\ErrorMonitoring\Facades\Centralog; use Illuminate\Foundation\Configuration\Exceptions; use Throwable; ->withExceptions(function (Exceptions $exceptions): void { $exceptions->report(fn (Throwable $e) => Centralog::capture($e)); })
Add extra context anywhere:
Centralog::context(['tenant' => 'acme', 'order_id' => 9182]);
Your local laravel.log keeps working as always — the SDK only sends a copy to Centralog.
Safety
- Short timeout (2s default), never blocks a request for long.
- Any network failure is swallowed and logged with
Log::debug. - Disabled automatically when
CENTRALOG_ENABLED=falseor endpoint/key are missing. - No queue worker required (synchronous by design).
Testing
composer test