febrysan / logcentral
Report Laravel exceptions to a central error-log API and serve a custom HTTP 500 page.
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.2 || ^8.0
- illuminate/contracts: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
- illuminate/http: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Requires (Dev)
- orchestra/testbench: ^6.40|^7.0|^8.0|^9.0|^10.0|^11.0
- phpunit/phpunit: ^9.5|^10.0|^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Laravel package that reports exceptions to a central error-log API and serves a custom HTTP 500 page.
Supports Laravel 8–13 on PHP 8.1+.
Install
composer require febrysan/logcentral
Package: packagist.org/packages/febrysan/logcentral. Laravel package discovery registers Febrysan\LogCentral\LogCentralServiceProvider. No edit to config/app.php is required.
Configuration
Copy env keys into the host app .env:
LOGCENTRAL_ENABLED=true LOGCENTRAL_ENDPOINT=http://localhost:8088/api/error-log-transactions LOGCENTRAL_API_KEY= LOGCENTRAL_TIMEOUT=3
Publish config and the 500 view (optional):
php artisan vendor:publish --tag=logcentral
Separate tags:
--tag=logcentral-config—config/logcentral.php--tag=logcentral-views—resources/views/vendor/logcentral
The HTML 500 page reports the exception synchronously so the API can return a LOG ID for that response. There is no queue.
LOGCENTRAL_API_KEY is sent as Authorization: Bearer … and is required by LogMonitor. The body follows the LogMonitor contract: occured_at, message, code, file, line, trace, url, method, ip_address, context, user_id, user_agent. Empty user_id is sent as -. The 500 page shows log_id from the 201 response (log_id or data.id).