imamhsn195/laravel-system-logs

A comprehensive Laravel package for viewing and managing system logs with an intuitive web interface

Maintainers

Package info

github.com/imamhsn195/laravel-system-logs

pkg:composer/imamhsn195/laravel-system-logs

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-01-24 15:43 UTC

This package is auto-updated.

Last update: 2026-03-24 17:10:01 UTC


README

Latest Version Total Downloads License

A comprehensive Laravel package for viewing and managing system logs with an intuitive web interface.

Features

  • 📋 View log entries from multiple files
  • 🔍 Advanced filtering and search (channel, level, environment, date, text search)
  • 🗑️ Delete single or bulk entries
  • 📁 Recursive directory scanning with depth limits
  • 🎨 Flexible layout support (works with any Laravel layout)
  • 🔒 Security features (path validation, file size limits)
  • 📱 Responsive design
  • 🌐 Multi-language support
  • ⚡ Real-time filtering via AJAX

Requirements

  • PHP 8.1 or higher
  • Laravel 10.x, 11.x, or 12.x

Installation

Via Packagist (Recommended)

composer require imamhsn195/laravel-system-logs

Via Composer (from GitHub)

If you need to install from the GitHub repository directly:

Add the repository to your composer.json:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/imamhsn195/laravel-system-logs"
        }
    ],
    "require": {
        "imamhsn195/laravel-system-logs": "dev-main"
    }
}

Then run:

composer require imamhsn195/laravel-system-logs:dev-main

Configuration

Publish the configuration file:

php artisan vendor:publish --tag=system-logs-config

This will create config/system-logs.php where you can customize:

  • Log directory path
  • Route prefix and middleware
  • Permission names
  • UI layout
  • Filter defaults
  • Directory scanning options
  • Security settings

Usage

Basic Usage

After installation, navigate to /admin/system-logs (or your configured prefix).

Custom Layout

The package supports any Laravel layout. Configure it in config/system-logs.php:

'ui' => [
    'layout' => 'layouts.app', // Your layout name
    'title' => 'System Logs',
],

Permissions

The package uses Laravel's permission system. Configure permission names:

'permissions' => [
    'view' => 'system-log.view',
    'delete' => 'system-log.delete',
],

Make sure to add these permissions to your permission system.

Publishing Assets

Publish CSS and JavaScript files:

php artisan vendor:publish --tag=system-logs-assets

Publishing Views (Optional)

If you want to customize the views:

php artisan vendor:publish --tag=system-logs-views

Publishing Translations (Optional)

If you want to customize translations:

php artisan vendor:publish --tag=system-logs-lang

Features

Filtering

  • Channel: Filter by log channel (single, daily, stack, etc.)
  • File: Filter by specific log file
  • Level: Filter by log level (debug, info, warning, error, etc.)
  • Environment: Filter by environment (local, production, etc.)
  • Date: Filter entries by specific date
  • Search: Full-text search across messages and context

Deletion

  • Single Entry: Delete individual log entries
  • Bulk Delete: Delete multiple selected entries
  • Bulk Delete by Filters: Delete all entries matching current filters (with confirmation)

Recursive Scanning

The package can scan subdirectories recursively:

'scanning' => [
    'recursive' => true,
    'max_depth' => 10,
    'exclude_directories' => ['.git', 'node_modules', '.cache'],
],

Configuration Options

Log Directory

'log_directory' => storage_path('logs'),

Route Configuration

'route' => [
    'prefix' => 'admin/system-logs',
    'middleware' => ['web', 'auth'],
    'name_prefix' => 'system-logs.',
],

UI Configuration

'ui' => [
    'layout' => 'layouts.app',
    'layout_type' => 'extend',
    'section_name' => 'content',
    'title' => 'System Logs',
],

Filter Defaults

'filters' => [
    'default_per_page' => 50,
    'min_per_page' => 10,
    'max_per_page' => 300,
    'default_max_files' => 3,
    'min_max_files' => 1,
    'max_max_files' => 20,
],

API Routes

  • GET /admin/system-logs - View log entries
  • DELETE /admin/system-logs - Delete single entry
  • DELETE /admin/system-logs/bulk - Bulk delete selected entries
  • DELETE /admin/system-logs/bulk-by-filters - Bulk delete by filters

Testing

./vendor/bin/phpunit

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Security

If you discover any security-related issues, please email imamhasan@example.com instead of using the issue tracker.

License

MIT License. See LICENSE file for details.

Author

Imam Hasan

Support

If you find this package useful, please consider giving it a ⭐ on GitHub!

Changelog

Please see CHANGELOG for more information on what has changed recently.