Laravel Log Viewer
A lightweight Laravel and Lumen package that reads your log files and displays them in a clean, filterable web interface.
Repository Health
Technical Analysis
Laravel Log Viewer is a small package that turns your application’s raw log files into a browsable web interface. Instead of tailing storage/logs/laravel.log over SSH, you register a single route and get a paginated, sortable table of log entries with their level, date, and stack traces rendered in the browser.
It reads Laravel’s and Lumen’s default log format, lets you switch between multiple log files, filter by severity, and download or delete individual files. The package is intentionally minimal - it ships a controller, a Blade view, and a log-parsing class - so it drops into an existing project with almost no configuration.
What You Get
- A ready-made controller and Blade view for browsing logs via a single route
- Parsing of Laravel/Lumen log entries into level, date, and message with stack traces
- Multi-file support to switch between and manage several log files
- Severity filtering plus download and delete actions for log files
- Near-zero configuration - register the service provider and add one route
Common Use Cases
- Inspecting application errors in the browser during local development
- Reviewing logs on staging or shared servers without SSH access to tail files
- Filtering by log level to find errors and warnings quickly
- Downloading or clearing individual log files from a simple UI
Under The Hood
Architecture - The package centers on src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php, which scans the configured log directory, reads a selected file, and parses each line with regular expressions into structured entries (level, header/date, stack text). A classmapped controller under src/controllers handles the route actions - view, switch file, download, delete - and renders a Blade view from src/views. A service provider registers the view namespace and (optional) config.
Tech Stack - PHP 8.2+ with a single runtime dependency on illuminate/support (Laravel 12/13). It uses PSR-0 autoloading for the library plus a classmap for controllers; dev tooling is PHPUnit and Orchestra Testbench.
Code Quality - A tests/ suite validates log parsing across formats against a Testbench app. The implementation is deliberately compact, with the log-parsing regexes as the most delicate part; its longevity and broad contributor base have hardened it against many real-world log variations.
API Design - Integration is essentially a single route pointed at the controller, making setup trivial. Configuration is limited to the log path and a few view options, and the parsing/rendering happen automatically, so the learning curve is very low for any Laravel developer.