rap2hpoutre/laravel-log-viewer
Lightweight Laravel log viewer for Laravel 12/13. Install via Composer and add a single route to LogViewerController to browse app logs in the browser. No public assets or vendor routes; works with or without log rotation. View and config are publishable.
auth, admin), addressing compliance needs without requiring a full observability stack. Can be extended with IP whitelisting or 2FA for sensitive environments.tail -f) and browser-based debugging.laravel-masking) to address PII/GDPR requirements.storage/logs/laravel.log) and uncompressed (no .gz or .zip files)..gz, .zip) or non-standard log paths (e.g., custom log channels)."This open-source log viewer cuts debugging time by 30%+ with a 5-minute setup—no infrastructure costs or vendor lock-in. For $0, we replace ad-hoc CLI log checks with a secure, browser-based UI for Laravel, reducing reliance on DevOps. Ideal for dev/staging environments where speed matters most. Trade-off: Not a replacement for centralized logging, but a force multiplier for troubleshooting."
*"Replace
tail -f storage/logs/laravel.logwith a searchable, color-coded log viewer accessible via/logs. Pros:
- 3-step install: Composer + route + middleware.
- Customizable: Publish Blade views/config to match your app’s design.
- Lightweight: No assets, no bloat—just logs. Gotchas:
- Lock behind
authmiddleware (logs often contain sensitive data).- Works best with uncompressed logs (
.log, not.gz).- Not for production (use centralized logging there). Example route:
Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index'])->middleware('auth'); ```"*
*"Security Risks:
- Logs may contain PII, API keys, or passwords. Misconfigured routes (e.g., unprotected
/logs) could expose vulnerabilities.- Mitigations:
- Restrict access via middleware (e.g.,
auth,admin, or IP whitelisting).- Exclude production from log viewer usage (environment checks in middleware).
- Pair with log masking (e.g.,
laravel-masking) for sensitive data. Production Note: This is not a replacement for centralized logging (e.g., ELK, CloudWatch). Use only in dev/staging."*
*"Use this to reduce MTTR for bugs in non-production environments. Example:
- Add a
/logslink to your staging dashboard for QA teams.- Trade-offs:
- Skip if your roadmap includes a full observability platform (e.g., Datadog).
- Not suitable for production or distributed logs. Quick Win: Implement in 2 hours vs. weeks of custom development."*
*"Stop asking Devs for logs—self-serve with
/logs!
- Filter by date/time to find specific errors.
- Search for keywords (e.g.,
500,timeout).- Works with Laravel’s daily log rotation. Tip: Bookmark the
/logspage for your staging environment!"*
How can I help you explore Laravel packages today?