kssadi/log-tracker

A powerful, intuitive, and efficient log viewer for Laravel applications.

1.3.0 2025-03-17 10:23 UTC

This package is auto-updated.

Last update: 2025-05-17 10:37:44 UTC


README


Log Tracker Laravel Package

📜 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.

GitHub Repo stars Downloads GitHub license GitHub top language Packagist Version

🚀 Features

Interactive Dashboard – View log statistics with charts & analytics.
Error Pattern Analysis – Identify top error types and peak error hours.
Log Filtering & Searching – Filter logs by level, date, or keywords.
Log File Management – View, download, and delete log files easily.
Customizable Configuration – Define log levels, colors, and icons.

Table of Contents

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

  1. Install the package via Composer:

    composer require kssadi/log-tracker
  2. Publish the configuration file:

    php artisan vendor:publish --provider="Kssadi\LogTracker\LogTrackerServiceProvider" --tag="config"

    This will publish the log-tracker.php configuration file to your config directory.

Configuration

After publishing the config, you can modify config/log-tracker.php file

return [
    'route_prefix' => 'log-tracker',
    'middleware' => ['web', 'auth'],
    'log_levels' => [
        'emergency' => ['color' => '#DC143C', 'icon' => 'fas fa-skull-crossbones'], 
        'alert'     => ['color' => '#FF0000', 'icon' => 'fas fa-bell'],             
        'critical'  => ['color' => '#FF4500', 'icon' => 'fas fa-exclamation-triangle'], 
        'error'     => ['color' => '#FF6347', 'icon' => 'fas fa-exclamation-circle'],   
        'warning'   => ['color' => '#FFA500', 'icon' => 'fas fa-exclamation-triangle'], 
        'notice'    => ['color' => '#32CD32', 'icon' => 'fas fa-info-circle'],         
        'info'      => ['color' => '#1E90FF', 'icon' => 'fas fa-info-circle'],         
        'debug'     => ['color' => '#696969', 'icon' => 'fas fa-bug'],                 
        'total'     => ['color' => '#008000', 'icon' => 'fas fa-file-alt'],            
    ],

    'per_page' => 50,
    'max_file_size' => 50,
    'allow_delete' => false,
    'allow_download' => true,
];

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

Access the Log Dashboard

To access the log tracker dashboard, navigate to /log-tracker in your browser. You can filter logs by level, date, or search for specific keywords.

http://your-app.test/log-tracker

📄 View Log Files

http://your-app.test/log-tracker/log-file

🔍 Search & Filter Logs

  • Search logs by keywords.
  • Filter logs by level (Error, Warning, Info, Debug).
  • Filter logs by date (Last hour, Today, Last 7 days, Custom range).

📥 Download Log Files

Click the Download button from a log file.

🗑 Delete Log Files

Click the Delete button to delete a log file.

Screenshots

Log Tracker Dashboard

Log Tracker Log File

Log Tracker Log File

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.

Author

Name: Khaled Saifullah Sadi
Email: mdsadi4@gmail.com

Buy Me a Coffee

License

This package is open-source software licensed under the MIT license.

📝 Changelog

Check out the CHANGELOG for the latest updates and features.

🤝 Support

Need help? Open an Issue or Discussion on GitHub! If you like this project, ⭐️ Star it on GitHub.

Social Handles

LinkedIn Facebook Instagram Twitter Github

Copyright 2025 Khaled Saifullah Sadi