Download the PHP package shrestharikesh/log-viewer without Composer
On this page you can find all versions of the php package shrestharikesh/log-viewer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download shrestharikesh/log-viewer
More information about shrestharikesh/log-viewer
Files in shrestharikesh/log-viewer
Package log-viewer
Short Description High-performance, memory-safe log viewer for Laravel. Streams files of any size (10GB–100GB+) without loading them into memory. Pluggable into any admin dashboard.
License MIT
Homepage https://github.com/shrestharikesh/log-viewer
Informations about the package log-viewer
Laravel Log Explorer
A high-performance, memory-safe log viewer for Laravel. It streams log files of any size — 10 GB, 50 GB, 100 GB+ — in a flat ~few-MB memory footprint, and drops into any existing admin dashboard (Filament, Nova, Tailwind, Bootstrap, custom) as a route, a Blade component, or an embedded widget.
Visit /admin/logs (configurable) — or embed it:
Why it's fast
Nothing ever loads a whole file. Every operation is byte-offset based and
streamed via fopen/fseek/fread/fgets:
| Operation | Technique | Cost |
|---|---|---|
| Tail last N | Reverse chunk-scan from EOF until N newlines (LineScanner) |
O(bytes of last N lines) |
| Pagination | Opaque byte-offset cursors — fseek to any page |
O(1) seek |
| Previous page | Backward chunk-scan to the boundary N lines up, then read forward | O(page) |
| Search | Streamed line-by-line, or shell out to ripgrep/grep | O(scanned) |
| Live tail | Poll size, read only appended bytes (tail -f) |
O(new bytes) |
| Download | Chunked fread stream, never buffered |
O(chunk) |
Long lines are capped (max_line_length) while byte offsets stay exact, so a
pathological newline-free file still can't exhaust memory.
Installation
Define the authorization gates in app/Providers/AppServiceProvider.php:
That's it — open /admin/logs.
Integration modes
Standalone route (default): config('log-explorer.routes.prefix') → /admin/logs.
Blade component / embedded widget — works inside any dashboard:
To render the standalone route inside your app's chrome, set
ui.layout in the config to your layout view name.
Configuration highlights
See the published config for every option (all documented inline).
JSON API
All endpoints are under {prefix}/api and are guarded by the view gate.
| Method & path | Purpose | Key query params |
|---|---|---|
GET /api/files |
List log files | source |
GET /api/files/show |
File metadata | file |
GET /api/view |
Cursor-paginated read | file, cursor, direction, limit |
GET /api/tail |
Last N lines | file, lines |
GET /api/search |
Streamed search | file, q, regex, case, level, from, to, cursor |
GET /api/stream |
SSE live tail | file, cursor |
GET /api/download |
Guarded streamed download | file, confirm, mode=tail&lines=N |
Cursors are opaque base64 byte offsets carrying a file fingerprint, so a rotated/truncated file is detected and reset rather than returning garbage.
Extensibility
LogSourceInterface + LocalLogSource are the seam for multi-server support —
the entire reading engine is written against the interface and a seekable
stream, so a remote driver is a drop-in.
Testing
The performance suite asserts every operation allocates under 50 MB even on
multi-GB files. Fixtures are generated by streaming writes (see
tests/Support/FixtureGenerator.php).
See ARCHITECTURE.md for the full design, directory map, and extensibility roadmap.
All versions of log-viewer with dependencies
illuminate/contracts Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/support Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^8.0 || ^9.0 || ^10.0 || ^11.0 || ^12.0
symfony/process Version ^5.4 || ^6.0 || ^7.0