ahmedmerza / logscope
A fast, database-backed log viewer for Laravel applications
Requires
- php: ^8.2
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- laravel/framework: ^11.0|^12.0|^13.0
Requires (Dev)
- laravel/pint: ^1.18
- laravel/sanctum: ^4.0
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^5.0
- pestphp/pest-plugin-laravel: ^3.0|^5.0
Suggests
- laravel/sanctum: Token authentication for the opt-in v1 JSON API (routes.api).
Provides
None
Conflicts
None
Replaces
None
- dev-master
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.0
- v2.0.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.9
- v1.5.8
- v1.5.7
- v1.5.6
- v1.5.5
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- v0.6.1
- v0.6.0
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.0
- v0.3.2
- v0.3.1
- v0.3.0
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
- dev-fix/grouped-panel-layout
This package is auto-updated.
Last update: 2026-10-04 06:32:03 UTC
README
A log viewer for Laravel that stores your logs in your own database, so you can search, filter and triage them from the browser.
Search by field (level:error, user_id:42) or across everything. Repeated errors are grouped into one issue with a count, and when you mark an issue resolved it stays resolved, unless it happens again. LogScope is designed to be left on in production, and it works alongside Telescope in development or an exception tracker like Sentry.
Quick Start
composer require ahmedmerza/logscope php artisan logscope:install php artisan migrate
Visit /logscope in your browser. That's it!
What's New
v2.3.1: grouped rollups survive an InnoDB deadlock under concurrent flushes, and the grouped view's issue/occurrence panel, keyboard shortcuts and layout are fixed on every screen size, from a 240px phone to an ultrawide monitor.
Upgrading: no migration. Full notes are in the changelog.
✨ Features
- Captures everything, no setup. Every log from every channel, each with its trace ID, user ID, IP, URL and user agent.
- Search and filters.
field:valuesearch, regex and a NOT toggle. Include or exclude by level, channel, HTTP method and date range, with one-click quick filters. - Issues and triage. Repeated entries are grouped into one issue with an occurrence count. Mark an issue open, investigating, resolved or ignored, and add notes. A resolved issue reopens if it happens again.
- Readable context. Collapsible, syntax-highlighted JSON. Request and model objects are expanded, and passwords, tokens and other sensitive keys are redacted.
- Keyboard-first. Vim-style navigation, and one key to change an issue's status and move to the next. Dark mode included.
- Shareable. Filters live in the URL, and every entry has its own link.
- Fast on big tables. Keyset pagination, writes batched until after the response, and indexes on the common filters.
📋 Requirements
- PHP 8.2+ (8.3+ for Laravel 13)
- Laravel 11, 12 or 13
- SQLite, MySQL, or PostgreSQL
🤔 When to Use LogScope
LogScope stores logs in your database - a deliberate choice that works great for most Laravel apps.
Great fit if you:
- Want log visibility without external services
- Have a typical Laravel app (up to ~100K requests/day)
- Need rich search and filtering
- Prefer simplicity over infrastructure complexity
Consider alternatives if you:
- Process millions of requests daily
- Need months/years of log retention
- Already use centralized logging (Datadog, CloudWatch, ELK)
How LogScope handles common concerns:
| Concern | Solution |
|---|---|
| Database bloat | Retention policies with scheduled pruning (default: 30 days) |
| Performance | Batch mode writes logs after response is sent |
| Query speed | Proper indexes on common filter combinations |
🔒 Authorization
Outside the local environment, /logscope is closed until you allow access. Checked in order:
1. Custom Callback:
LogScope::auth(fn ($request) => $request->user()?->isAdmin());
2. Gate:
Gate::define('viewLogScope', fn ($user) => $user->hasRole('admin'));
3. Default: Only accessible in local environment.
📚 Documentation
- Configuration — capture and write modes, writes during transactions, retention, noise filters, routes, theme, redaction of sensitive keys and headers, and every environment variable.
- Usage — search syntax, the status workflow and custom statuses, quick filters, keyboard shortcuts, custom context, and the Artisan commands.
- Production Deployment — recommended settings, scheduling
logscope:prune, and high-traffic apps. - JSON API — the opt-in, token-authenticated v1 API for native clients: setup with Sanctum, access, and every endpoint.
- Known Limitations — the few kinds of log that bypass Laravel's logger, and what to do about each.
🛡️ Extensions
Watchtower
Block malicious IPs and sync the blacklist across all your environments automatically. Blocking is done from Watchtower's own dashboard — LogScope shows you the traffic, Watchtower acts on it. (Previously named ahmedmerza/logscope-guard.)
composer require ahmedmerza/watchtower php artisan watchtower:install
🤝 Contributing
Contributions are welcome! Please open an issue or submit a pull request.
📄 License
MIT License. See LICENSE for details.
