arukompas/better-log-viewer
A Laravel log viewer with a faster, filterable interface for browsing application logs. Supports multiple log files, level filtering, search, and a clean UI for debugging production issues. Install via Composer and access through a configurable route for quick log inspection without external service...
Install into a Laravel app (package supports auto-discovery):
composer require arukompas/better-log-viewer
Publish the config so you can see the route prefix, middleware, and log-path settings:
php artisan vendor:publish --provider="Arukompas\BetterLogViewer\BetterLogViewerServiceProvider"
Inspect the resulting config file first — it tells you the exact route, the directory being read (storage/logs by default), and which middleware guards it.
Hit the route in the browser (typically /logs or whatever prefix the config exposes). You should see a list of log files; click one to see parsed entries with a search box and pagination.
First real use case: reproducing a production/staging exception. Search the daily log for the exception class or a request ID, page through results, and copy the stack trace — this is where the search + pagination combo beats tail -f or grepping by hand.
Because the package is archived, treat it as read-only infrastructure: pin the version, vendor it if you rely on it long-term, and do not expect fixes. If you are starting fresh, evaluate opcodesio/log-viewer (same maintainer, actively maintained) before committing to this one.
Guard the route with real auth. The single most important integration step is putting admin auth in front of it:
// config/better-log-viewer.php
'middleware' => ['web', 'auth', 'can:viewLogs'],
or restrict to non-production via a service provider Gate::define/abort_unless check on app()->isLocal().
Environment gating. Register the service provider (or publish the route) conditionally so the viewer never exists in production:
// AppServiceProvider::register()
if (! app()->isProduction()) {
$this->app->register(\Arukompas\BetterLogViewer\BetterLogViewerServiceProvider::class);
}
Workflow: search-driven triage. Typical loop is open latest daily file → search by exception class, correlation ID, or a route path → page to the first occurrence → copy the trace into your issue tracker. Search across a paged file is the package's core value; it is not a metrics/alerting tool.
Admin panel integration. If you use Filament/Nova/a custom dashboard, expose a link to the viewer route from the admin nav rather than remembering the URL. Since routes are config-driven, read the prefix from config when building the link so it stays in sync.
Read-only local mirroring. For staging, mount or symlink storage/logs from the app server into the box running the viewer so you can search without SSH-ing per request. Keep the viewer process off the public internet.
Keep log channel compatible. Stick to Laravel's default single/daily line format; anything custom (JSON channel, multi-line stack traces with custom formatting) may parse poorly since the viewer assumes standard log lines.
composer.json (extra.laravel.dont-discover) or you'll get the route in production anyway.config/better-log-viewer.php won't apply until php artisan config:clear — a common "why is it still public?" debugging trap.storage/logs. On containerized setups where logs are written by a different UID, you'll get an empty list rather than an error — verify with ls -l before debugging the package./logs route or another viewer installed, change the prefix in config rather than fighting route order.opcodesio/log-viewer.How can I help you explore Laravel packages today?