Weave Code
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

Log Viewer Laravel Package

shaonmajumder/log-viewer

Beautiful, secure Laravel log viewer for Laravel 9–11 and PHP 8+. Auto-discovers log files, highlights levels, supports themes, search and level filtering, context expansion, tail mode, auto-refresh, and downloading full or filtered output.

View on GitHub
Deep Wiki
Context7

🚀 Laravel Log Viewer


✨ Features

🛡️ Security First

  • 🔐 Admin-protected routes
  • 🚫 Path traversal protection
  • 🧠 Custom authorization callback
  • 🧱 Middleware configurable

📄 Smart Log Discovery

Automatically detects:

  • laravel.log
  • laravel-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 Graphite
  • Dark 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

![Main Viewer](assets/screenshots/log-viewer-main.png)

![Context Expansion](assets/screenshots/log-viewer-context.png)

![Auto Refresh](assets/screenshots/log-viewer-refresh.png)

🧱 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

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.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky