rap2hpoutre/laravel-log-viewer
View Laravel and Lumen log files in the browser with a lightweight log viewer. Install via Composer, register the service provider, and add a single route to LogViewerController—no public assets or vendor routes. Works with rotated logs.
Install the package via Composer, register the service provider, and add a simple route to view logs in the browser:
composer require rap2hpoutre/laravel-log-viewer
In config/app.php (or bootstrap/app.php for Lumen), add:
Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider::class,
Define a route in routes/web.php:
Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']);
Visit /logs to see an interactive, color-coded log viewer with search and filtering. First-time users should check the troubleshooting tip about clearing config cache if they encounter view resolution errors.
/logs to inspect recent errors, warnings, and info messages.auth or admin) to prevent exposing sensitive logs:
Route::get('logs', [...])->middleware('auth');
log.blade.php view via vendor:publish --tag=views to match your app’s UI or add custom highlighting.config/logviewer.php (published via vendor:publish) to point to non-default log paths (e.g., storage/logs/custom.log).daily log channels—no extra config needed beyond ensuring logs follow laravel-{date}.log naming.php artisan config:clear after installation or config changes—cached configs commonly break view resolution.storage/logs/ owned by www-data/apache)..gz). Ensure your logging config doesn’t auto-compress logs.LogViewerController by extending it and swapping routes—e.g., to add date range filtering or export functionality.logviewer.php config or log view customizations to public repos—log files often contain credentials or PII.How can I help you explore Laravel packages today?