Convert Figma logo to code with AI

ARCANEDEV logoLogViewer

:page_with_curl: Provides a log viewer for Laravel

2,362
336
2,362
17

Top Related Projects

:dromedary_camel: Laravel log viewer

Fast and beautiful Log Viewer for Laravel

Laravel N+1 Query Detector

Debugbar for Laravel (Integrates PHP Debug Bar)

Clockwork - php dev tools in your browser - server-side component

Quick Overview

ARCANEDEV/LogViewer is a Laravel package that provides a user-friendly interface for viewing and managing application logs. It offers a clean and intuitive dashboard to browse, search, and analyze log files, making it easier for developers and system administrators to troubleshoot issues and monitor application performance.

Pros

  • Easy integration with Laravel applications
  • User-friendly interface for log management
  • Supports log level filtering and search functionality
  • Customizable and extendable

Cons

  • Limited to Laravel framework
  • May require additional setup for complex logging scenarios
  • Performance might be affected when dealing with large log files
  • Requires proper security configuration to prevent unauthorized access

Code Examples

  1. Installing the package via Composer:
composer require arcanedev/log-viewer
  1. Publishing the package configuration:
php artisan vendor:publish --provider="Arcanedev\LogViewer\LogViewerServiceProvider"
  1. Accessing log data in a controller:
use Arcanedev\LogViewer\Contracts\LogViewer;

public function index(LogViewer $logViewer)
{
    $stats = $logViewer->statsTable();
    $logs = $logViewer->all();
    
    return view('logs.index', compact('stats', 'logs'));
}
  1. Displaying log entries in a Blade template:
@foreach($entries as $entry)
    <tr>
        <td>{{ $entry->datetime->format('Y-m-d H:i:s') }}</td>
        <td><span class="label label-{{ $entry->level_class }}">{{ $entry->level }}</span></td>
        <td>{{ $entry->header }}</td>
    </tr>
@endforeach

Getting Started

  1. Install the package via Composer:

    composer require arcanedev/log-viewer
    
  2. Add the service provider to config/app.php (Laravel 5.4 and below):

    Arcanedev\LogViewer\LogViewerServiceProvider::class,
    
  3. Publish the configuration file:

    php artisan vendor:publish --provider="Arcanedev\LogViewer\LogViewerServiceProvider"
    
  4. Access the log viewer at http://your-app.com/log-viewer

  5. Customize the configuration in config/log-viewer.php as needed

Competitor Comparisons

:dromedary_camel: Laravel log viewer

Pros of laravel-log-viewer

  • Simpler setup and configuration process
  • Lightweight with fewer dependencies
  • Easier to customize and extend due to its simplicity

Cons of laravel-log-viewer

  • Less feature-rich compared to LogViewer
  • Limited styling options and user interface customization
  • Fewer built-in security features

Code Comparison

LogViewer configuration:

'route'         => [
    'enabled'    => true,
    'attributes' => [
        'prefix'     => 'log-viewer',
    ],
],

laravel-log-viewer configuration:

Route::get('logs', '\Rap2hpoutre\LaravelLogViewer\LogViewerController@index');

LogViewer offers more granular configuration options, while laravel-log-viewer provides a simpler setup with fewer customization possibilities. LogViewer's approach allows for more flexibility in routing and security settings, whereas laravel-log-viewer focuses on quick implementation with minimal configuration.

Both packages serve the purpose of viewing Laravel logs, but LogViewer provides a more comprehensive solution with additional features and customization options. laravel-log-viewer is better suited for simpler projects or those requiring minimal log viewing functionality.

Fast and beautiful Log Viewer for Laravel

Pros of Log Viewer

  • More modern UI with real-time log tailing and search functionality
  • Supports multiple log file formats, including Laravel, Apache, and Nginx
  • Offers a standalone package that can be used outside of Laravel applications

Cons of Log Viewer

  • Requires PHP 8.0 or higher, which may not be suitable for older projects
  • Less extensive documentation compared to LogViewer
  • Newer project with potentially fewer community contributions and extensions

Code Comparison

LogViewer:

use Arcanedev\LogViewer\Facades\LogViewer;

$logs = LogViewer::all();
$entries = LogViewer::entries($file, $date, $level);

Log Viewer:

use Opcodes\LogViewer\Facades\LogViewer;

$files = LogViewer::getFiles();
$logs = LogViewer::getLogsFromFile($fileName);

Both packages offer similar functionality for retrieving log files and entries, but Log Viewer's API is slightly more straightforward. LogViewer provides more granular control over log retrieval, allowing filtering by date and log level in a single method call.

Overall, Log Viewer offers a more modern and user-friendly interface with real-time features, while LogViewer provides a more established and well-documented solution with broader PHP version compatibility. The choice between the two depends on project requirements and PHP version constraints.

Laravel N+1 Query Detector

Pros of laravel-query-detector

  • Focuses specifically on detecting and alerting about N+1 queries, which can significantly impact performance
  • Provides real-time notifications in the browser console or as an alert, making it easier to catch issues during development
  • Lightweight and easy to integrate into existing Laravel projects

Cons of laravel-query-detector

  • Limited to query detection and doesn't provide comprehensive log viewing capabilities
  • May not be as useful in production environments compared to a full-featured log viewer

Code Comparison

LogViewer:

use Arcanedev\LogViewer\Facades\LogViewer;

$logs = LogViewer::all();
$entries = LogViewer::entries($file, $date, $level);

laravel-query-detector:

// In AppServiceProvider.php
public function boot()
{
    QueryDetector::enableQueryDetection();
}

Summary

LogViewer is a comprehensive log viewing solution for Laravel applications, offering a wide range of features for managing and analyzing logs. On the other hand, laravel-query-detector is a specialized tool focused on detecting and alerting about N+1 queries in real-time during development. While LogViewer provides a broader set of log management capabilities, laravel-query-detector excels in its specific use case of improving query performance. The choice between the two depends on whether you need a full-featured log viewer or a targeted solution for query optimization.

Debugbar for Laravel (Integrates PHP Debug Bar)

Pros of Laravel Debugbar

  • Provides real-time debugging information directly in the browser
  • Offers a wide range of metrics including database queries, request data, and memory usage
  • Integrates seamlessly with Laravel's built-in features and other popular packages

Cons of Laravel Debugbar

  • Can impact performance when enabled in production environments
  • May expose sensitive information if not properly configured
  • Requires manual installation and configuration, unlike some built-in Laravel tools

Code Comparison

LogViewer:

use Arcanedev\LogViewer\Facades\LogViewer;

$logs = LogViewer::all();
$entries = LogViewer::entries($file, $date, $level);

Laravel Debugbar:

use Barryvdh\Debugbar\Facade as Debugbar;

Debugbar::info($object);
Debugbar::error('Error!');
Debugbar::startMeasure('render','Time for rendering');

While LogViewer focuses on parsing and displaying log files, Laravel Debugbar provides a more comprehensive debugging toolkit. LogViewer is specifically designed for log management, offering a clean interface for viewing and analyzing log entries. On the other hand, Laravel Debugbar offers real-time insights into various aspects of application performance and behavior, making it a valuable tool for development and debugging. The choice between the two depends on specific project needs and debugging preferences.

Clockwork - php dev tools in your browser - server-side component

Pros of Clockwork

  • Provides real-time debugging and profiling capabilities
  • Offers a browser extension for easy access to debugging information
  • Supports multiple frameworks and platforms beyond Laravel

Cons of Clockwork

  • Requires additional setup and configuration
  • May have a higher performance overhead in production environments

Code Comparison

Clockwork usage:

use Clockwork\Support\Clockwork;

Clockwork::info('User logged in');
Clockwork::startEvent('long-operation', 'Performing a long operation');
// ... code for long operation
Clockwork::endEvent('long-operation');

LogViewer usage:

use Illuminate\Support\Facades\Log;

Log::info('User logged in');
// LogViewer automatically captures and displays this log entry

Key Differences

  • LogViewer focuses on displaying and managing log files, while Clockwork provides more comprehensive debugging tools
  • Clockwork offers more detailed performance profiling and request inspection
  • LogViewer is specifically designed for Laravel, while Clockwork supports multiple frameworks
  • LogViewer has a built-in web interface, whereas Clockwork relies on a browser extension

Use Cases

  • Choose LogViewer for simple log management and viewing in Laravel applications
  • Opt for Clockwork when you need advanced debugging, profiling, and cross-framework support

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

LogViewer Packagist License For Laravel

Github Workflow Status Coverage Status Scrutinizer Code Quality SensioLabs Insight Github Issues

Packagist Packagist Release Packagist Downloads

By ARCANEDEV©

This package allows you to manage and keep track of each one of your log files.

NOTE: You can also use LogViewer as an API.

Official documentation for LogViewer can be found at the _docs folder.

Feel free to check out the releases, license, and contribution guidelines.

Features

  • A great Log viewer API.
  • Laravel 5.x to 11.x are supported.
  • Ready to use (Views, Routes, controllers … Out of the box) [Note: No need to publish assets]
  • View, paginate, filter, download and delete logs.
  • Load a custom logs storage path.
  • Localized log levels.
  • Logs menu/tree generator.
  • Grouped logs by dates and levels.
  • Customized log levels icons (font awesome by default).
  • Works great with big logs !!
  • Well documented package (IDE Friendly).
  • Well tested (100% code coverage with maximum code quality).

Table of contents

  1. Installation and Setup
  2. Configuration
  3. Usage

Supported localizations

Dear artisans, i'm counting on you to help me out to add more translations ( ^_^)b

LocalLanguage
arArabic
bgBulgarian
bnBengali
deGerman
enEnglish
esSpanish
etEstonian
faFarsi
frFrench
heHebrew
huHungarian
hyArmenian
idIndonesian
itItalian
jaJapanese
koKorean
msMalay
nlDutch
plPolish
pt-BRBrazilian Portuguese
roRomanian
ruRussian
siSinhalese
svSwedish
thThai
trTurkish
ukUkrainian
uzUzbek
zhChinese (Simplified)
zh-TWChinese (Traditional)

Contribution

Any ideas are welcome. Feel free to submit any issues or pull requests, please check the contribution guidelines.

Security

If you discover any security related issues, please email arcanedev.maroc@gmail.com instead of using the issue tracker.

Credits

PREVIEW

Dashboard Logs list Single log