ibrahim-eng12/log-owl

A Laravel package to view, navigate, filter logs with descriptions and solutions

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/ibrahim-eng12/log-owl

v1.0.0 2026-02-03 23:43 UTC

This package is auto-updated.

Last update: 2026-02-10 00:15:12 UTC


README

A Laravel package to view, navigate, and filter application logs with intelligent error descriptions and suggested solutions.

LogOwl Logo

Gallery

LogOwl Screenshot 1    LogOwl Screenshot 2

Features

  • 📋 View and navigate Laravel log files
  • 🔍 Filter logs by level, date range, and search terms
  • 📊 Statistics dashboard showing error counts by level and type
  • 💡 Intelligent error analysis with descriptions and solutions
  • 🌍 Multi-language support (English & Arabic)
  • 🔄 RTL (Right-to-Left) layout support for Arabic
  • 🎨 Clean, responsive UI
  • 🔐 Protected with authentication middleware
  • 📥 Download and clear log files
  • 📱 Mobile-friendly interface

Installation

1. Install via Composer

composer require ibrahim-eng12/log-owl

2. Publish Configuration (Optional)

php artisan vendor:publish --tag=log-viewer-config

3. Publish Views (Optional)

php artisan vendor:publish --tag=log-viewer-views

4. Publish Translations (Optional)

php artisan vendor:publish --tag=log-viewer-lang

5. Publish Assets - Logo (Optional)

php artisan vendor:publish --tag=log-owl-assets

This will publish the logo to public/vendor/log-owl/logo.png.

Configuration

After publishing the configuration, you can modify config/log-viewer.php:

return [
    // URL prefix for log viewer routes
    'route_prefix' => 'logs',

    // Middleware applied to all routes
    'middleware' => ['web', 'auth'],

    // Path to log files
    'log_path' => storage_path('logs'),

    // Logs per page
    'per_page' => 25,

    // Restrict to specific users (empty = all authenticated)
    'allowed_users' => [],

    // Allow clearing log files
    'allow_clear' => true,

    // Allow downloading log files
    'allow_download' => true,

    // Default locale (null = use app locale)
    'locale' => null,

    // Available locales for the language switcher
    'available_locales' => [
        'en' => 'English',
        'ar' => 'Arabic',
    ],
];

Usage

After installation, navigate to /logs in your browser (while authenticated) to access LogOwl.

Routes

Route Method Description
/logs GET View logs dashboard
/logs/show/{id} GET Get log entry details (JSON)
/logs/clear POST Clear current log file
/logs/download GET Download current log file
/logs/set-locale POST Change language (stored in session)

Filtering Logs

  • By Level: Filter by emergency, alert, critical, error, warning, notice, info, debug
  • By Search: Search within log messages and error types
  • By Date: Filter by date range

Supported Error Types

LogOwl recognizes and provides solutions for common Laravel errors:

  • Database Errors: Connection issues, missing tables/columns, duplicates
  • Authentication Errors: Unauthenticated access, CSRF mismatches
  • File Errors: Permission denied, file not found
  • View Errors: Missing Blade templates
  • Class/Method Errors: Class not found, undefined methods
  • Route Errors: Route not defined, method not allowed, 404
  • Memory/Timeout Errors: Memory exhausted, execution timeout
  • Queue Errors: Failed jobs, max attempts exceeded
  • Cache/Session Errors: Store not configured
  • Mail Errors: Transport failures
  • And many more...

Multi-Language Support

LogOwl supports multiple languages with a built-in language switcher. Currently supported languages:

  • English (en) - Default
  • Arabic (ar) - With full RTL support

Changing the Default Language

Set the default locale in your configuration:

'locale' => 'ar', // Set Arabic as default

Or leave it as null to use your application's current locale.

Adding a New Language

  1. Publish the translation files:
php artisan vendor:publish --tag=log-viewer-lang
  1. Copy one of the existing language files (e.g., en/log-viewer.php) to a new folder with your language code (e.g., fr/log-viewer.php)

  2. Translate all strings in the new file

  3. Add the new locale to your configuration:

'available_locales' => [
    'en' => 'English',
    'ar' => 'Arabic',
    'fr' => 'French',
],

RTL Support

The interface automatically switches to RTL (Right-to-Left) layout when Arabic is selected. The RTL detection is based on the current locale.

Customization

Adding Custom Error Patterns

Extend the LogParser service to add custom error patterns:

use Ibrah\LaravelLogViewer\Services\LogParser;

class CustomLogParser extends LogParser
{
    protected array $errorPatterns = [
        // Add your custom patterns (pattern => translation_key)
        'MyCustomException' => 'my_custom_error',
        // ... parent patterns will be inherited
    ];
}

Then add the translation key to your language files:

// resources/lang/vendor/log-viewer/en/log-viewer.php
'error_types' => [
    'my_custom_error' => [
        'type' => 'Custom Error',
        'description' => 'Description of the error.',
        'solutions' => [
            'Solution 1',
            'Solution 2',
        ],
    ],
    // ... other error types
],

Register in a service provider:

$this->app->singleton(LogParser::class, CustomLogParser::class);

Custom Views

Publish and modify the views:

php artisan vendor:publish --tag=log-viewer-views

Views will be published to resources/views/vendor/log-viewer/.

Security

  • All routes are protected by the auth middleware by default
  • Configure allowed_users to restrict access to specific users
  • Disable allow_clear and allow_download in production if needed

Requirements

  • PHP 8.1+
  • Laravel 10.0, 11.0, or 12.0

License

MIT License