kssadi / log-tracker
A powerful, intuitive, and efficient log viewer for Laravel applications.
Requires
- php: >=5.6
- illuminate/support: >=5.1
Requires (Dev)
- orchestra/testbench: >=3.6 <=9.0
README

📜 Laravel Log Tracker
Laravel Log Tracker is a powerful, user-friendly package for tracking, analyzing, and managing application logs effortlessly. It provides a real-time dashboard with filtering, insights, and visualization of your log files.
🚀 Key Features
✅ Interactive Dashboard – Comprehensive log analytics with charts and real-time insights
✅ Dual Theme System – Choose between LiteFlow (minimal) and GlowStack (modern) themes
✅ Zero-Dependency Exports – Export logs in CSV, Excel, PDF, JSON without external libraries
✅ Error Pattern Analysis – Identify top error types and peak error hours
✅ Advanced Filtering – Filter logs by level, date range, or custom keywords
✅ Log File Management – View, download, delete, and manage log files effortlessly
✅ Smart File Pagination – Efficiently handle large numbers of log files with pagination (New in v2.1)
✅ Dynamic Log Levels – Laravel log levels with dynamic colors and icons (New in v2.1)
✅ Max File Size Protection – Intelligent file size checking to prevent memory issues (New in v2.1)
✅ Real-time Statistics – Live log counts and performance metrics
✅ Stack Trace Viewer – Detailed error stack traces with syntax highlighting
✅ Responsive Design – Works perfectly on desktop, tablet, and mobile devices
✅ Customizable Configuration – Tailor log levels, colors, icons, and behavior to your needs
✅ Performance Optimized – Handles large log files efficiently with enhanced pagination (Improved in v2.1)
✅ Secure Access – Built-in authentication and authorization middleware
Table of Contents
🖥️ System Requirements
Supported PHP and Laravel Versions
Laravel Version | Supported PHP Versions |
---|---|
12.x | 8.1 - 8.4 |
11.x | 8.1 - 8.3 |
10.x | 8.0 - 8.2 |
9.x | 8.0 - 8.1 |
8.x | 7.3 - 8.0 |
7.x | 7.2 - 7.4 |
6.x | 7.2 - 7.4 |
5.8 | 7.1 - 7.3 |
5.7 | 7.1 - 7.2 |
5.6 | 7.0 - 7.2 |
5.5 | 7.0 - 7.2 |
✅ Checked Versions
Laravel Version | PHP Version | Status |
---|---|---|
12.x | 8.2, 8.4 | ✅ Working |
11.x | 8.2, 8.3 | ✅ Working |
10.x | 8.1, 8.2 | ✅ Working |
9.x | 8.0, 8.1 | ⚠️ Not Tested |
8.x | 7.4, 8.0 | ⚠️ Not Tested |
Note: If you encounter issues with a specific version, feel free to report them in the issues section.
Installation
-
Install the package via Composer:
composer require kssadi/log-tracker
-
Publish the configuration file:
php artisan vendor:publish --provider="Kssadi\LogTracker\LogTrackerServiceProvider" --tag="config"
This will publish the
log-tracker.php
configuration file to yourconfig
directory.
🔄 Upgrading to v2.1
⚠️ Important for Existing Users
If you're upgrading from a previous version (v2.0 or earlier), you MUST update your configuration file to get the new features and settings.
📋 Quick Upgrade Steps:
1. Update the Package
composer update kssadi/log-tracker
2. Update Configuration File
⚠️ IMPORTANT: Choose one of these methods:
Method A: Force Re-publish (Overwrites your config)
php artisan vendor:publish --provider="Kssadi\LogTracker\LogTrackerServiceProvider" --tag="config" --force
⚠️ Warning: This will overwrite your existing config. Backup your custom settings first!
Method B: Manual Merge (Recommended)
# Backup your current config cp config/log-tracker.php config/log-tracker-backup.php # Publish new config to compare php artisan vendor:publish --provider="Kssadi\LogTracker\LogTrackerServiceProvider" --tag="config" --force # Manually merge your custom settings from backup
Method C: Download and Compare
- Download the latest config: config/log-tracker.php
- Compare with your existing config and add new options
🆕 New in v2.1 Config:
log_files_per_page
- Configure pagination for log files listing- Enhanced
log_levels
with dynamic colors and icons - Additional pagination settings
- Improved export configurations
✅ Verify Your Upgrade:
# Check if new config options are available php artisan log-tracker:theme list # Test the new pagination feature # Visit: /log-tracker/log-file
Configuration
Basic Configuration
After publishing the config, customize your config/log-tracker.php
file:
<?php return [ /* |-------------------------------------------------------------------------- | Route Configuration |-------------------------------------------------------------------------- */ 'route_prefix' => 'log-tracker', 'middleware' => ['web', 'auth'], /* |-------------------------------------------------------------------------- | Theme Selection |-------------------------------------------------------------------------- */ 'theme' => 'GlowStack', // Options: 'LiteFlow', 'GlowStack' /* |-------------------------------------------------------------------------- | Display Settings |-------------------------------------------------------------------------- */ 'log_per_page' => 50, 'log_files_per_page' => 10, 'max_file_size' => 50, // MB /* |-------------------------------------------------------------------------- | Feature Permissions |-------------------------------------------------------------------------- */ 'allow_delete' => true, 'allow_download' => true, /* |-------------------------------------------------------------------------- | Export Configuration |-------------------------------------------------------------------------- */ 'export' => [ 'enabled' => true, 'formats' => [ 'csv' => [ 'enabled' => true, 'description' => 'Excel-compatible CSV format' ], 'json' => [ 'enabled' => true, 'description' => 'Structured JSON with metadata' ], 'excel' => [ 'enabled' => true, 'description' => 'Native Excel XML format' ], 'pdf' => [ 'enabled' => true, 'description' => 'Print-ready HTML report' ], ], 'limits' => [ 'max_entries' => 50000, 'max_file_size_mb' => 50, 'timeout_seconds' => 300, ], 'storage' => [ 'cleanup_after_days' => 7, ], ], ];
Environment Configuration
Add the following environment variables to your .env
file:
LOG_CHANNEL=daily # Recommended for structured logging LOG_LEVEL=debug # Set the minimum log level to be recorded
Log Channel Configuration
Update your config/logging.php
file to use the daily
log channel:
'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), 'days' => 30, // Keep logs for the last 30 days ],
Usage
🏠 Dashboard Access
Navigate to the main dashboard to get an overview of your logs:
https://your-domain.com/log-tracker
Dashboard Features:
- Real-time log statistics
- Error pattern analysis
- Peak error hours visualization
- Recent log entries
- Daily log trends (last 7 days)
📁 Log File Management
View and manage individual log files:
https://your-domain.com/log-tracker/log-file
Available Actions:
- 👁️ View - Browse log entries with pagination
- 📥 Download - Download original log files
- 📊 Export - Export logs in various formats
- 🗑️ Delete - Remove log files (if enabled)
🔍 Advanced Filtering
Filter by Log Level:
- Emergency, Alert, Critical
- Error, Warning, Notice
- Info, Debug
Filter by Time:
- Last hour
- Today
- Last 7 days
- Custom date range
Search Features:
- Keyword search in log messages
- Multiple search terms support
📝 Generating Log Examples
To test and populate your logs with different types of entries, you can use Laravel's built-in Log
facade. Here are some practical examples:
<?php use Illuminate\Support\Facades\Log; // Basic log levels Log::info('User logged in successfully', ['user_id' => 123]); Log::warning('Disk space is running low', ['disk_usage' => '85%']); Log::error('Payment processing failed', ['order_id' => 'ORD-12345', 'error' => 'Gateway timeout']); // Emergency and Critical logs Log::emergency('Database connection lost completely'); Log::critical('Memory limit exceeded', ['memory_usage' => '512MB']); Log::alert('Security breach detected', ['ip_address' => '192.168.1.100']); // Debug and Notice logs Log::debug('API response received', ['response_time' => '250ms', 'endpoint' => '/api/users']); Log::notice('User password changed', ['user_id' => 456]); // Logs with context data Log::error('File upload failed', [ 'file_name' => 'document.pdf', 'file_size' => '5MB', 'user_id' => 789, 'error_code' => 'UPLOAD_TIMEOUT' ]); // Exception logging try { // Some risky operation throw new \Exception('Sample exception for testing'); } catch (\Exception $e) { Log::error('Exception caught: ' . $e->getMessage(), [ 'file' => $e->getFile(), 'line' => $e->getLine(), 'trace' => $e->getTraceAsString() ]); }
📊 View Generated Logs: After running these examples in your Laravel application (via tinker, controllers, or artisan commands), visit your log tracker dashboard to see them categorized and displayed beautifully!
Themes
Laravel Log Tracker offers two distinct themes to match your workflow and preferences:
Available Themes
Theme | Description | Features |
---|---|---|
🌊 LiteFlow | Minimal, clean log view with streamlined interface | Clean design, fast loading, excellent readability |
✨ GlowStack | Modern, colorful, enhanced visual log view | Rich colors, advanced styling, enhanced user experience |
Theme Configuration
Set your preferred theme in config/log-tracker.php
:
'theme' => 'GlowStack', // Options: 'LiteFlow', 'GlowStack'
🎨 Theme Management via Artisan Commands
Laravel Log Tracker provides convenient Artisan commands to manage themes without editing configuration files:
List Available Themes
php artisan log-tracker:theme list
Output:
Available Log Tracker Themes:
• GlowStack
• LiteFlow ← Current
Check Current Theme
php artisan log-tracker:theme current
Output:
Current Theme: LiteFlow
Switch Theme
# Switch to GlowStack theme php artisan log-tracker:theme set GlowStack # Switch to LiteFlow theme php artisan log-tracker:theme set LiteFlow
Example Usage:
# Check what themes are available php artisan log-tracker:theme list # Switch to the modern GlowStack theme php artisan log-tracker:theme set GlowStack # Verify the change php artisan log-tracker:theme current
💡 Pro Tip: Theme changes take effect immediately - no cache clearing or server restart required!
Theme Features
🌊 LiteFlow Theme:
- Minimalist design philosophy
- Faster page loads with reduced styling
- Perfect for high-frequency log monitoring
- Clean, distraction-free interface
- Optimized for performance
✨ GlowStack Theme (Default):
- Modern, vibrant color scheme
- Enhanced visual hierarchy
- Rich animations and transitions
- Advanced styling elements
- Improved user engagement
📤 Export Features
Export your logs in multiple formats for external analysis and reporting with zero external dependencies:
Supported Export Formats
Format | Extension | Description | Features |
---|---|---|---|
📊 CSV | .csv |
Excel-compatible CSV format | Universal compatibility, easy data analysis |
📈 Excel | .xlsx |
Native Excel XML format | Rich formatting, ready for spreadsheet analysis |
.pdf |
Print-ready HTML report | Professional reports, easy sharing | |
🔗 JSON | .json |
Structured JSON with metadata | API integration, programmatic processing |
Export Configuration
Configure export settings in config/log-tracker.php
:
'export' => [ 'enabled' => true, 'formats' => [ 'csv' => [ 'enabled' => true, 'description' => 'Excel-compatible CSV format' ], 'json' => [ 'enabled' => true, 'description' => 'Structured JSON with metadata' ], 'excel' => [ 'enabled' => true, 'description' => 'Native Excel XML format' ], 'pdf' => [ 'enabled' => true, 'description' => 'Print-ready HTML report' ], ], 'limits' => [ 'max_entries' => 50000, // Maximum records per export 'max_file_size_mb' => 50, // Max file size for processing 'timeout_seconds' => 300, // Export timeout ], 'storage' => [ 'cleanup_after_days' => 7, // Auto-cleanup exported files ], ],
Export Features
✅ No External Dependencies - All export formats work out of the box
✅ Large File Support - Handle up to 50,000 log entries per export
✅ Smart Filtering - Export only filtered/searched results
✅ Auto Cleanup - Exported files are automatically cleaned up after 7 days
✅ Format Flexibility - Enable/disable specific export formats as needed
How to Export
- Navigate to any log file view
- Click the "Export" button
- Select your preferred format
- Choose date range and filters
- Download the generated file
Screenshots
📚 API Documentation
Available Routes
// Dashboard GET /log-tracker // Log file list GET /log-tracker/log-file // View specific log file GET /log-tracker/{logName} // Download log file GET /log-tracker/download/{logName} // Export log file POST /log-tracker/export/{logName} // Delete log file (if enabled) POST /log-tracker/delete/{logName}
Middleware
Default middleware can be customized in configuration:
'middleware' => ['web', 'auth'],
Contributing
We welcome contributions! Follow these steps to get started:
1️⃣ Fork the Repository
Click the Fork button on the top-right of this repository to create your copy.
2️⃣ Clone Your Fork
Run the following command to clone the repository to your local machine:
git clone https://github.com/your-username/Laravel-Log-Tracker.git
cd Laravel-Log-Tracker
3️⃣ Create a New Branch
Before making changes, create a new branch:
git checkout -b my-new-feature
4️⃣ Make Your Changes & Commit
After making your modifications, commit your changes:
git add . git commit -m "Added feature: real-time log monitoring"
5️⃣ Push to GitHub & Create a Pull Request
Push your changes to GitHub:
git push origin my-new-feature
Now, go to your forked repository on GitHub and click "New Pull Request" to submit your changes for review.
🐛 Bug Reports
Found a bug? Please report it with:
- Laravel and PHP versions
- Steps to reproduce
- Expected vs actual behavior
- Error messages or logs
🎉 What's New in v2.1
🚀 Performance & Reliability Improvements
- Smart File Pagination: Handles large numbers of log files efficiently
- Enhanced Log Pagination: Improved navigation through log entries
- Max File Size Protection: Prevents memory issues with oversized files
- Dynamic Laravel Log Levels: Beautiful colors and icons for better visual feedback
🐛 Bug Fixes
- Resolved HTML syntax errors affecting UI rendering
- Enhanced code efficiency and performance optimizations
- Improved error handling for edge cases
🔧 Technical Enhancements
- Optimized codebase for better maintainability
- Enhanced memory management for large files
- Improved UI responsiveness and reliability
📝 Changelog
Check out the CHANGELOG for the latest updates and features.
🆘 Support
📞 Get Help
- 🐛 Bug Reports: GitHub Issues
- 💬 Feature Requests: GitHub Discussions
- 📖 Documentation: Wiki
- 💌 Email Support: mdsadi4@gmail.com
⭐ Show Your Support
If Laravel Log Tracker helps your project:
- ⭐ Star the repository on GitHub
- 🍵 Buy me a coffee to fuel development
- 📢 Share with the Laravel community
- 📝 Write a review or blog post
Author
Khaled Saifullah Sadi
Full Stack Developer & Laravel Enthusiast
🌐 Connect With Me
📄 License
This package is open-source software licensed under the MIT License.
MIT License
Copyright (c) 2025 Khaled Saifullah Sadi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
⭐ If you find this package useful, please consider giving it a star! ⭐
Made with ❤️ for the Laravel Community
Copyright © 2025 Khaled Saifullah Sadi. All rights reserved.