Download the PHP package kssadi/log-tracker without Composer
On this page you can find all versions of the php package kssadi/log-tracker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kssadi/log-tracker
More information about kssadi/log-tracker
Files in kssadi/log-tracker
Package log-tracker
Short Description A powerful, intuitive, and efficient log viewer for Laravel applications.
License MIT
Homepage https://github.com/kssadi/log-tracker
Informations about the package log-tracker
π Laravel Log Tracker
Laravel Log Tracker is a powerful, zero-dependency package for viewing, analyzing, searching, comparing, and exporting your Laravel application logs β with a beautiful dual-theme UI, real-time dashboard, alert notifications, and full PHPUnit test coverage.
Table of Contents
- Requirements
- Installation
- Configuration
- Features
- Dashboard
- Log File Management
- Log Viewer
- Global Search
- Log Comparison
- Export
- Alerts & Notifications
- Themes
- Artisan Commands
- Routes Reference
- Testing
- Screenshots
- Changelog
- Support
- Author
- License
π₯οΈ Requirements
| Laravel | PHP |
|---|---|
| 13.x | 8.3 β 8.5 |
| 12.x | 8.1 β 8.4 |
| 11.x | 8.1 β 8.3 |
| 10.x | 8.1 β 8.2 |
π¦ Installation
1. Install via Composer:
2. Publish the configuration file:
3. (Optional) Publish views to customise them:
βοΈ Configuration
After publishing, edit config/log-tracker.php:
Recommended .env settings
Recommended log channel config (config/logging.php)
π Features
π Dashboard
URL: /log-tracker
The main dashboard aggregates data from all log files into a single at-a-glance view:
- Summary counters β total entries and per-level breakdown
- Today's activity β entries logged today, broken down by level
- 7-day trend β date-keyed table of the past week's activity
- Last 5 recent logs β most recent log entries across all files
- Top error types β most frequent error message prefixes
- Peak hours β hour-of-day histogram showing when errors peak
- Live auto-refresh β JSON endpoint (
/api/dashboard-refresh) polled by the UI without a full page reload
π Log File Management
URL: /log-tracker/log-file
- Paginated file listing with human-readable names (
laravel-2025-06-01.logβ01 June 2025) - File size displayed beside each entry
- Per-file level breakdown counts (how many errors, warnings, etc.)
- Actions per file: View, Download, Delete (if
allow_delete = true)
π Log Viewer
URL: /log-tracker/{filename}
A full-featured viewer for a single log file:
| Feature | Detail |
|---|---|
| Level filter | Toggle individual log levels on/off |
| Real-time search | Instant keyword filter across message and timestamp |
| Pagination | Configurable entries per page |
| Stack trace viewer | Expand/collapse per entry with syntax highlighting β frame numbers gold, file paths teal, line numbers red |
| Copy to Clipboard | One-click copy for any log message and for full stack traces; icon changes to β for 2 s visual feedback |
| Row Bookmark | Bookmark any row with π; row highlighted in gold, bookmarks stored in localStorage and survive page reloads |
| Show Marked Only | Toggle button in the header (shows count) to display only bookmarked rows |
| Frequent Entries panel | Collapsible table of the top 15 repeated messages with occurrence count, first seen, and last seen timestamps |
| Clear log | Wipe file contents without deleting the file (requires allow_delete = true) |
| Quick export | Export current file in any supported format directly from the viewer |
π Global Search
URL: /log-tracker/search
Search across all log files simultaneously without opening each one:
- Keyword search β case-insensitive, matches message body and stack trace content
- Level filter β narrow results to a specific log level
- Date range β
date_fromanddate_tofilters - File filter β restrict the search to a specific log file
- Paginated results β newest-first ordering, source filename shown per result
- Results decorated with per-level colour coding and icons
βοΈ Log Comparison
URL: /log-tracker/compare
Select any two log files for a full side-by-side content diff:
| Tab | Description |
|---|---|
| Only in File A | Entries that exist only in the first file |
| Only in File B | Entries that exist only in the second file |
| Shared | Entries present in both files (matched by level + message fingerprint) |
Additional information displayed:
- Per-level count breakdown table for each file
- Total entry counts for both files
- Guard against selecting the same file twice (null comparison shown)
π€ Export
URL: /log-tracker/export
Quick export: /log-tracker/export/{filename}/{format}
Export filtered log data β no external package dependencies required:
| Format | Extension | Notes |
|---|---|---|
| CSV | .csv |
UTF-8 BOM β opens correctly in Excel |
| JSON | .json |
Includes export_info metadata (generated_at, filters, exported_by) |
| Excel | .xls |
Native Office Open XML format β no PHPSpreadsheet needed |
.pdf |
Print-ready HTML report (capped at first 1 000 entries) |
Available filters: specific files, log levels, date range, keyword.
Export files are stored temporarily and automatically deleted after cleanup_after_days days.
π Alerts & Notifications
The alert system monitors log files on a rolling time window and triggers notifications when entry counts for any level exceed configured thresholds.
Run manually:
Auto-schedule β when alerts.enabled = true the package registers a once-per-minute scheduler entry automatically. Ensure your scheduler cron is active:
Notification Channels
| Channel | How to enable |
|---|---|
Set enabled = true, set to to recipient email; uses the application's default mailer |
|
| Slack | Create an Incoming Webhook in your Slack app and paste the URL |
| Discord | Server Settings β Integrations β Webhooks β copy URL |
| Webhook | Any HTTP endpoint β POST or GET, custom headers supported |
π¨ Themes
Two production-ready themes are bundled. Switching theme requires no cache clear.
| Theme | Style | Best for |
|---|---|---|
| GlowStack | Dark, colorful, gradient-based | Modern dashboards, low-light environments |
| LiteFlow | Light, minimal, clean | High-contrast readability, print-friendly |
Set theme in config:
Custom themes β add a new folder under resources/views/vendor/log-tracker/theme/YourTheme/ containing dashboard.blade.php, logs.blade.php, log-details.blade.php, search.blade.php, compare.blade.php, and export.blade.php. The package discovers it automatically.
π οΈ Artisan Commands
| Command | Description |
|---|---|
log-tracker:check-alerts |
Check all log files against thresholds and send configured notifications |
log-tracker:cleanup [--days=7] |
Delete temporary export files older than N days |
log-tracker:theme list |
List all available themes |
log-tracker:theme current |
Show the currently active theme |
log-tracker:theme set {name} |
Switch to the specified theme |
πΊοΈ Routes Reference
All routes are grouped under the configured route_prefix (default: log-tracker) with the configured middleware.
| Method | URI | Route name | Description |
|---|---|---|---|
| GET | /log-tracker |
log-tracker.dashboard |
Main dashboard |
| GET | /log-tracker/api/dashboard-refresh |
log-tracker.api.dashboard.refresh |
Live dashboard JSON refresh |
| GET | /log-tracker/log-file |
log-tracker.index |
Log file listing |
| GET | /log-tracker/search |
log-tracker.search |
Global multi-file search |
| GET | /log-tracker/compare |
log-tracker.compare |
Side-by-side file comparison |
| GET | /log-tracker/export |
log-tracker.export.form |
Export form |
| POST | /log-tracker/export |
log-tracker.export |
Trigger export download |
| GET | /log-tracker/export/{logName}/{format} |
log-tracker.export.quick |
Quick export from viewer |
| GET | /log-tracker/download/{logName} |
log-tracker.download |
Download raw log file |
| POST | /log-tracker/delete/{logName} |
log-tracker.delete |
Delete log file |
| POST | /log-tracker/clear/{logName} |
log-tracker.clear |
Clear log file contents |
| GET | /log-tracker/{logName} |
log-tracker.show |
View log entries |
π§ͺ Testing
The package ships with a comprehensive PHPUnit test suite covering controllers, services, and Artisan commands. Tests run standalone via orchestra/testbench β no parent Laravel project required.
Clone the repository and install dev dependencies:
Run all tests:
Run by suite:
Run a single test file:
Coverage Summary
| Suite | Test File | What it covers |
|---|---|---|
| Feature | LogFileControllerTest |
Index, show, download, delete, clear, pagination, path traversal guard |
| Feature | DashboardControllerTest |
Stats structure, 7-day dates, live refresh JSON endpoint, cache TTL behaviour |
| Feature | SearchControllerTest |
Keyword, level, date range, cross-file search, pagination |
| Feature | CompareControllerTest |
Shared/unique detection, level counts, same-file guard |
| Feature | ExportControllerTest |
CSV, JSON, Excel, PDF output format + validation |
| Feature | LogFrequencyTest |
Duplicate message detection, count sorting, first/last seen |
| Feature | CheckLogAlertsCommandTest |
Threshold breach detection, cooldown, notification dispatch |
| Feature | CleanupCommandTest |
Old export file removal by age |
| Feature | ThemeCommandTest |
List, current, set theme commands |
| Feature | ServiceProviderTest |
Container binding, facade, config publishing |
| Unit | LogParserServiceTest |
Log parsing, pagination, stack trace line detection, correct stack trace entry assignment |
| Unit | LogExportServiceTest |
CSV/JSON/Excel/PDF generation with filter combinations |
| Unit | ThemeManagerTest |
Theme discovery, fallback behaviour, view path resolution |
Current baseline: 177 tests, 461 assertions β all passing.
πΈ Screenshots
π Changelog
See CHANGELOG.md for a full release history and upgrade notes.
π Support
| Channel | Link |
|---|---|
| π Bug reports | GitHub Issues |
| π¬ Feature requests | GitHub Discussions |
| π Documentation | Official Site |
| π Email | [email protected] |
| β Buy me a coffee |
π€ Author
β€οΈ Supported by Business Automation Ltd
π License
Released under the MIT License.