Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Log Viewer

Laravel Log Viewer Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Laravel Log Viewer is a lightweight, self-contained log viewer for Laravel 12 and 13. Inspired by Micheal Mand's Laravel 4 log viewer, it requires no public assets and no vendor routes—just install it with Composer and register a route pointing to LogViewerController. It works with or without log rotation, making it a quick way to browse your application logs from the browser.

Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']);
  • Zero assets — no published files or vendor routes needed
  • Log rotate support — works with and without rotation
  • Customizable view — publish log.blade.php to override the UI
  • Configurable — publish logviewer.php for advanced settings
  • Simple install — one Composer command and one route
Frequently asked questions about Laravel Log Viewer
What is rap2hpoutre/laravel-log-viewer used for?
It is a small, read-only log viewer for Laravel that renders the log files Laravel already writes in storage/logs inside a Blade view. You install it with Composer, register a single route to LogViewerController, and browse logs in the browser at a path such as /logs. It is meant as a fast local or staging triage tool rather than a full observability platform, so it has no alerting, retention policy, or audit trail.
How do I install laravel-log-viewer with Composer?
Run composer require rap2hpoutre/laravel-log-viewer in your Laravel project. The service provider is auto-discovered, so no manual registration is needed on supported Laravel versions. Then add a route to Rap2hpoutre\LaravelLogViewer\LogViewerController and visit that URL.
How do I add and secure the /logs route?
Add Route::get('logs', [\Rap2hpoutre\LaravelLogViewer\LogViewerController::class, 'index']); to your web routes file. Because the package registers no vendor routes, the entire HTTP surface is the route you define. Wrap it in your existing auth middleware plus a role or ability check, or an IP allowlist, in the same commit as the route so logs are never publicly reachable.
Which Laravel and PHP versions does laravel-log-viewer support?
The current release targets Laravel 12 and 13 on PHP 8.x. Older Laravel versions and Lumen require pinning legacy releases, which are no longer maintained. If you are on Laravel 6 through 11, check the release notes and treat that pin as standing technical debt.
Does it work with daily log rotation and multiple log files?
Yes. The viewer is channel-agnostic and supports Laravel's single and daily rotation, so it can list and open rotated files such as laravel-2026-05-12.log. Version 2.0.0 added daily-log support and now raises an error on unreadable files instead of silently showing an empty viewer. That makes permission problems visible, but it can also surface as a 500 if storage/logs is not readable by the app user.
How do I customize the log viewer view or configuration?
Publish the Blade view with php artisan vendor:publish --provider="Rap2hpoutre\LaravelLogViewer\LaravelLogViewerServiceProvider" --tag=views, then edit resources/views/vendor/laravel-log-viewer/log.blade.php. Publish the config file with the same vendor:publish command without the tag to customize logviewer.php. This lets you adjust layout and viewer settings without forking the package.
Is it safe to enable laravel-log-viewer in production?
Only with deliberate controls. The viewer renders whatever is in storage/logs, which can include credentials, tokens, PII, or regulated data, so an open /logs route is an exfiltration path. Gate it behind authentication and authorization, add an APP_ENV guard confining it to local or staging, and review log hygiene and redaction before any production exposure. Treat production access as a named-owner decision, not a default.
Why is the log viewer slow or running out of memory on large log files?
The viewer reads and renders log files without pagination, so very large files cause slow responses and memory pressure. That is usually acceptable in local or staging environments but becomes risky if someone temporarily enables it in production. Rotate or truncate large logs, or avoid pointing the viewer at multi-gigabyte files.
Does it work with load-balanced or containerized deployments and centralized logging?
It only reads the local filesystem of the app server that handles the request, so on a load-balanced or containerized deployment /logs shows one replica's slice of history. It does not read CloudWatch, ELK, Loki, or S3 and does not meaningfully parse structured JSON channels. If you already have or are about to adopt a centralized logging platform, use that for production triage and keep this package as a local bridge.
I get an InvalidArgumentException in FileViewFinder.php — how do I fix it?
That error is usually caused by config caching interfering with the package's view resolution. Run php artisan config:clear and confirm the service provider is discovered and the route points at LogViewerController. Because it recurs in CI/CD, bake the clear step into your deploy scripts.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections