shaonmajumder / log-viewer
Reusable Laravel log viewer package with filtering, context expansion, and download support.
Package info
github.com/ShaonMajumder/log-viewer
Language:Blade
pkg:composer/shaonmajumder/log-viewer
Requires
- php: ^8.0
- illuminate/routing: ^9.0|^10.0|^11.0
- illuminate/support: ^9.0|^10.0|^11.0
- illuminate/view: ^9.0|^10.0|^11.0
This package is auto-updated.
Last update: 2026-05-09 23:50:29 UTC
README
๐ฅ Beautiful โข Secure โข Fast โข Real-Time Friendly Laravel Log Viewer
โจ Features
๐ก๏ธ Security First
- ๐ Admin-protected routes
- ๐ซ Path traversal protection
- ๐ง Custom authorization callback
- ๐งฑ Middleware configurable
๐ Smart Log Discovery
Automatically detects:
laravel.loglaravel-YYYY-MM-DD.log- rotated log files
- multiple Laravel log patterns
๐จ Beautiful Log Highlighting
Color-coded levels:
| Level | Highlight |
|---|---|
| โ ERROR | Red |
| โ ๏ธ WARNING | Yellow |
| โน๏ธ INFO | Blue |
| ๐ DEBUG | Gray |
๐ Theme Support
Built-in dark theme options:
Dark Ink(default)Dark GraphiteDark Forest
Theme can be changed directly from the viewer header, and the selection is saved in browser localStorage.
๐ Advanced Filtering
- ๐ Full-text search
- ๐ฏ Level filtering
- ๐ Match-only mode
- โก Instant filtering
๐ง Inline Context Expansion
Expand surrounding lines around matches:
No Contextยฑ2ยฑ5ยฑ10ยฑ20
Perfect for debugging stack traces and exceptions.
โฑ๏ธ Tail Mode Support
View latest logs instantly:
- No Limit
- 100
- 300
- 500
- 1000
- 2000
๐ฅ Filtered Download
Download:
- full logs
- filtered results
- contextual output
๐ Auto Refresh Controls
- Live refresh
- Pause on scroll
- Smart refresh handling
- Developer-friendly UX
๐ฆ Installation
โ Packagist (Recommended)
composer require shaonmajumder/log-viewer
๐งช Local Development (Path Repository)
Add to your Laravel app:
{
"repositories": [
{
"type": "path",
"url": "../log-viewer"
}
],
"require": {
"shaonmajumder/log-viewer": "*@dev"
}
}
Then run:
composer update shaonmajumder/log-viewer
โ๏ธ Publish Configuration
php artisan vendor:publish --tag=log-viewer-config
Publish views:
php artisan vendor:publish --tag=log-viewer-views
๐ Default Routes
| Route | Description |
|---|---|
/log-viewer |
Main log viewer |
/log-viewer/download |
Download logs |
๐ง Configuration
Published config:
config/log-viewer.php
Important Options
| Option | Description |
|---|---|
route_prefix |
Route prefix |
middleware |
Route middleware |
layout |
Blade layout |
heading |
Viewer heading |
๐ Access Control
Default behavior is fixed: only logged-in users can access /log-viewer.
- If user is not logged in, package redirects to
/login. - If user is logged in, package allows access.
- This access rule is enforced in package controller logic and does not depend on per-project auth config toggles.
๐ผ๏ธ Screenshots
  
๐งฑ Package Structure
src/
โโโ Http/
โ โโโ Controllers/
โ โโโ LaravelLogController.php
โ
โโโ LaravelLogViewerServiceProvider.php
routes/
โโโ web.php
config/
โโโ log-viewer.php
resources/
โโโ views/
โโโ index.blade.php
๐ก๏ธ Security Notes
โ ๏ธ Never expose production logs publicly.
Recommended:
- protect with authentication
- enforce admin authorization
- restrict access internally only
๐ Built For
โ
Production Laravel apps
โ
Admin panels
โ
DevOps dashboards
โ
Debugging tools
โ
Monitoring systems
โ
Internal engineering tools
โค๏ธ Why This Package?
Most Laravel log viewers are:
- outdated
- unsafe
- slow
- ugly
- missing filtering/context tools
This package focuses on:
โ
Developer Experience
โ
Security
โ
Performance
โ
Clean UI
โ
Real-world production usage
๐ Compatibility
| Framework | Supported |
|---|---|
| Laravel 9 | โ |
| Laravel 10 | โ |
| Laravel 11 | โ |
| PHP Version | Supported |
|---|---|
| PHP 8+ | โ |
๐ License
MIT ยฉ Shaon Majumder
โญ Support The Project
If this package helps you:
- โญ Star the repository
- ๐ด Fork it
- ๐ Report issues
- ๐ Contribute improvements
Built with โค๏ธ for Laravel developers