acolyte / laravel-errorlog
A secure Laravel error monitoring dashboard with grouping, redaction, and queued notifications.
Package info
github.com/ialaminpro/laravel-errorlog
Language:Blade
pkg:composer/acolyte/laravel-errorlog
Requires
- php: ^8.2
- illuminate/contracts: ^12.0 || ^13.0
- illuminate/database: ^12.0 || ^13.0
- illuminate/http: ^12.0 || ^13.0
- illuminate/mail: ^12.0 || ^13.0
- illuminate/notifications: ^12.0 || ^13.0
- illuminate/routing: ^12.0 || ^13.0
- illuminate/support: ^12.0 || ^13.0
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0 || ^11.0
- phpunit/phpunit: ^11.5 || ^12.0
README
A lightweight error monitoring dashboard for Laravel that captures application exceptions, groups recurring failures, persists diagnostic context, and sends optional queued notifications.
Overview
Laravel ErrorLog is for applications that need a small, inspectable error store without a hosted monitoring service. Version 2 rebuilds the established Packagist package around secure defaults, typed internals, automatic framework integration, deterministic grouping, and a documented upgrade path.
Features
- Automatic capture through Laravel's standard logged-exception events
- Explicit
ErrorLog::capture($throwable)API - Deterministic fingerprints and occurrence aggregation
- Recursive redaction of request input, headers, route parameters, and custom context
- Dashboard authorization via Laravel Gate or a callback
- RESTful, CSRF-protected resolve, reopen, and delete actions
- HTTP-, console-, queue-, and scheduler-safe context collection
- Optional queue-compatible Laravel notifications
- Testbench tests, PHPStan level 8, Pint, and Laravel 12–13 CI
Screenshot
The dashboard is server-rendered and dependency-free. It includes grouped error lists, filters, detail context, traces, and explicit state actions.
Requirements
| Laravel | PHP |
|---|---|
| 12.x | 8.2–8.5 |
| 13.x | 8.3–8.5 |
Composer 2 is required.
Installation
composer require acolyte/laravel-errorlog:^2.0 php artisan migrate
Laravel auto-discovers the provider. Publish configuration only when needed:
php artisan vendor:publish --tag=errorlog-config
Views and migrations are separately publishable with errorlog-views and errorlog-migrations.
Quick Start
Once installed and migrated, exceptions reported by Laravel are captured automatically:
throw new RuntimeException('Payment reconciliation failed');
For a caught exception or domain-specific context:
use Acolyte\ErrorLog\Facades\ErrorLog; ErrorLog::capture($throwable, ['operation' => 'reconciliation']);
Open /error-logs as an authenticated, authorized user.
Automatic Error Capture
The package listens for Laravel log events containing a Throwable, which is how the framework reports uncaught exceptions. It does not replace the application's exception handler. Set ERRORLOG_CAPTURE_AUTOMATIC=false to disable this integration; explicit capture remains available.
Dashboard and Authorization
Dashboard routes use web and auth by default, followed by package authorization. Define the viewErrorLog ability:
use Illuminate\Support\Facades\Gate; Gate::define('viewErrorLog', fn ($user) => $user->is_admin);
Or register a callback during application boot:
use Acolyte\ErrorLog\Facades\ErrorLog; ErrorLog::auth(fn ($request) => $request->user()?->isAdmin() === true);
The callback takes precedence over the Gate. Never remove authorization middleware unless an equivalent control exists.
Configuration
ERRORLOG_ENABLED=true ERRORLOG_CAPTURE_AUTOMATIC=true ERRORLOG_ROUTE_PREFIX=error-logs ERRORLOG_DB_CONNECTION= ERRORLOG_NOTIFICATIONS_ENABLED=false ERRORLOG_MAIL_TO=ops@example.com
The published config also controls middleware, Gate name, database table/connection, redaction replacement, and sensitive keys.
Notifications
Set a recipient and enable notifications. ErrorOccurredNotification implements ShouldQueue, so run a Laravel queue worker in production. Errors are committed before notification dispatch; delivery failure cannot roll back persistence. The reporter emits Acolyte\ErrorLog\Events\ErrorOccurred for additional channels.
Sensitive Data Redaction
Passwords, authorization/cookie headers, API keys, tokens, secrets, and common card fields are redacted recursively by default. Matching is case-insensitive and separator-normalized. Trace arguments are never stored. Add application-specific names to redaction.keys.
Error Grouping
Fingerprints use exception class, normalized message, file, and line. UUIDs, hexadecimal identifiers, and standalone numbers in messages are normalized. Recurrences increment occurrences and last_seen_at; first_seen_at remains unchanged.
Console and Queue Support
Without a resolved HTTP route, the normalizer records console runtime context without reading $_SERVER. Queue workers, schedules, Artisan, and tests do not require request metadata.
Testing
composer check
This runs Pint, PHPStan/Larastan at level 8, and PHPUnit/Testbench.
Version Compatibility
The 1.x line remains available for legacy applications. The 2.x line supports PHP 8.2+ and Laravel 12–13; Laravel 13 requires PHP 8.3+. Laravel 11 is not included because its framework security-support window has ended and its current component set is blocked by Composer's security advisory resolution.
Upgrading from v1
Read UPGRADE.md before changing the Composer constraint. The migration renames the legacy table, preserves and backfills existing rows, and adds the grouped-error schema. Configuration and routes intentionally changed; SendMails is deprecated.
Contributing
See CONTRIBUTING.md. Bug fixes should include regression coverage and pass composer check.
Security
Do not disclose vulnerabilities in public issues. Follow SECURITY.md.
License
Laravel ErrorLog is licensed under the MIT license.
