rap2hpoutre/laravel-log-viewer
A small log viewer for Laravel 12 and 13. Install via Composer and add a route to LogViewerController to browse logs in your browser. Works with or without log rotation, requires no public assets or vendor routes, and supports custom views and configuration.
Decision framing. Treat rap2hpoutre/laravel-log-viewer as a tactical debugging enabler, not a platform bet. It is a mature, single-purpose package (3.1k stars, MIT, active releases through 2026-05-12) with an explicit compatibility contract: Laravel 12 and 13, three-step install, one controller route. The low opportunity score (~43.7) and zero recorded dependents are portfolio signals: minimal strategic upside, minimal downstream blast radius. That combination makes it cheap to trial and cheap to reverse.
Architecture fit.
/logs shows one pod's slice of history — a correctness problem that surfaces as a product problem ("why can't QA see the error the customer reported?").Integration feasibility. Genuinely low effort: composer require, one route registration, optional vendor:publish for view and config. The real work is governance, not installation. Three gates a TPM should own before approval:
auth plus a role/ability check or IP allowlist) in the same PR that adds it. An unprotected /logs on a public host is a credential-and-PII exfiltration path and the single most likely way this package generates an incident.APP_ENV guard limiting the route to local/staging, unless a named owner accepts production exposure in writing.Key questions for the engineering owner.
laravel.log size in staging/prod? The controller reads and parses the whole file with no pagination — logs routinely over ~50MB will stall requests and pressure memory.php artisan pail, tail, or a managed aggregator? If so, this is a complement for historical/non-engineer access, not a replacement.Stack fit. Native to the Laravel monolith. It requires no infrastructure change, no new secrets, no runtime service dependency, and no CI modification beyond the composer lock update. Fit degrades to "poor" only where the organization has standardized on a centralized log aggregator or runs ephemeral containers — in those cases the viewer contradicts the platform's source-of-truth model.
Compatibility.
.gz will not open), Lumen, and Laravel ≤11 (older releases only, unmaintained).InvalidArgumentException in FileViewFinder.php; PHP-FPM user lacking read access on storage/logs/ produces an empty or erroring view rather than a clear permission message.Migration path. Greenfield — nothing to migrate. There is no data model, no schema, no state. Removal is composer remove plus deleting one route line; the only residue is a published view/config, which is inert without the route. This near-zero reverse cost is the core argument for approving a bounded trial.
Sequencing (recommended order):
composer require in the staging branch; register the route behind auth + a can:viewLogs Gate + throttle:30,1.app()->environment(['local','staging'])) so production is excluded by construction, not by convention.where('file', '[A-Za-z0-9_\-.]+') rule if deep-linking to specific files — this is the path-traversal control.billing, queues) appear in the file picker via config, not code changes.Extension discipline. Do not fork or subclass the vendor controller. Publish the view and build filtering/highlighting client-side; if server-side filtering or export is genuinely needed, that is the signal to move to a real aggregator rather than grow this package.
Maintenance. Very low but non-zero. MIT license, a single maintainer, one narrow responsibility, and a real release history (v1.0.0 → v2.0.0 → releases into 2026). Bus factor is 1, which is acceptable precisely because the blast radius is one route and the removal cost is minutes. Budget for periodic Laravel-major compatibility checks; do not budget for feature development.
Support. Support burden lands on whoever owns the route, not the vendor. Expect recurring tickets of four kinds: "logs page is blank" (permissions or config cache), "logs page is slow/timed out" (large file, no pagination), "I can't find X" (no server-side search), and "this isn't what production looks like" (multi-instance). Publish a one-page runbook covering php artisan config:clear, the sudo -u www-data test -r check, and the rotation policy. Also publish an explicit statement that this is not an incident-response tool.
Scaling. The weakest dimension. Three independent ceilings:
daily channel plus days => 7 and a configured max size, not with code changes.Failure modes and controls.
| Failure mode | Symptom | Product-level control |
|---|---|---|
| Route deployed without middleware | Public /logs, log contents indexed or scraped |
Access-control gate in the same PR; environment guard; post-deploy smoke check |
| Secrets/PII in log lines | Credentials or customer data readable over HTTP | Redaction at the logging layer; audit Log::info/debug payloads before enabling |
| Stale config cache | FileViewFinder exception on first visit |
Runbook step: config:clear; include in deploy checklist |
Permissions on storage/logs/ |
Empty or erroring view, no clear cause | Pre-flight read check as the web user |
| Oversized log file | Slow page, worker exhaustion | Max-size config, aggressive rotation, staging-only exposure |
| Path traversal via file param | Arbitrary file read | Constrain the route parameter; never expose unbounded file selection |
| Multi-instance drift | QA cannot reproduce what a customer saw | Document the limitation; do not position as production triage |
Ramp-up. Effectively zero for a Laravel developer: the README is three lines and the controller is small enough to read in one sitting. Budget half a day for the first engineer to install, secure, and document it; under an hour for subsequent environments. The real onboarding cost is organizational — teaching QA and support what the tool does and does not show, and getting the security review of the access-control and environment gates done once, properly, rather than per-team.
Recommendation. Approve a time-boxed, staging-scoped trial with the access-control and environment gates as hard preconditions. Success criteria are qualitative and modest: fewer SSH sessions for routine log checks, and non-engineers able to read logs unaided. Do not approve production exposure, do not fund extensions beyond the published view, and re-evaluate against your log-aggregator roadmap at the end of the trial — if that roadmap lands, retire this package rather than maintain both.
How can I help you explore Laravel packages today?