fqathf/loglytics 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fqathf/loglytics

Composer 安装命令:

composer require fqathf/loglytics

包简介

A lightweight and powerful Crashlytics-like log viewer package for Laravel.

README 文档

README

Latest Stable Version Build Status License PHP Version

A lightweight and powerful Crashlytics-like log viewer package for Laravel. Parse, track, and manage your Laravel application logs with a beautiful standalone UI.

Features

  • Crashlytics-style Error Grouping — Errors automatically grouped by exception type
  • Bug Status Tracking — Mark occurrences as solved or open
  • Bulk Status Updates — Select and update multiple entries at once
  • Level Filtering — Filter by ERROR, WARNING, INFO, DEBUG
  • Date Range Filtering — Preset ranges (1 day, 1 week, etc.) or custom dates
  • Severity & Trend Analysis — Visual indicators for severity and trend direction
  • CSV Export — Export filtered log data to CSV
  • Dark Mode — Toggle between light and dark themes
  • Log Caching — Parsed results cached for better performance
  • Standalone UI — Bootstrap 5 + Feather Icons via CDN, no conflicts with your admin panel
  • Configurable Authorization — Gate-based or allow-list authorization
  • Rate Limiting — Built-in rate limiting on write operations
  • Supports Laravel 10, 11

Requirements

  • PHP ^8.1
  • Laravel ^10.0 | ^11.0
  • SQLite or MySQL/PostgreSQL (for bug status tracking)

Installation

composer require fqathf/loglytics

The service provider is auto-discovered. Run migrations:

php artisan migrate

Optional: Publish Configuration

# Publish config only
php artisan vendor:publish --tag=loglytics-config

# Publish views (to customize UI)
php artisan vendor:publish --tag=loglytics-views

# Publish migrations (to customize table)
php artisan vendor:publish --tag=loglytics-migrations

Quick Start

Navigate to /log-viewer in your browser. Done!

Configuration

Route & Middleware

// config/loglytics.php
'route' => [
    'prefix' => 'log-viewer',        // Change URL prefix
    'middleware' => ['web', 'auth'],  // Add your middleware
    'domain' => null,                 // e.g. 'logs.example.com'
],

Authorization

Protect the log viewer with a Gate:

// app/Providers/AuthServiceProvider.php
public function boot()
{
    Gate::define('viewLogViewer', function ($user) {
        return $user->isAdmin();
    });
}
// config/loglytics.php
'authorization' => [
    'enabled' => true,
    'gate' => 'viewLogViewer',
],

Or use an allow-list:

'authorization' => [
    'enabled' => true,
    'allow_only' => [1, 2, 3], // User IDs
],

UUID Support

If your users table uses UUIDs:

'database' => [
    'user_model' => \App\Models\User::class,
    'user_primary_key_type' => 'uuid',
],

Custom Log Path

'log_path' => '/var/log/my-app', // Absolute path

Caching

'cache' => [
    'enabled' => true,
    'prefix' => 'loglytics',
    'ttl' => 60, // seconds
],

Integration Guide

Minimal Setup

composer require fqathf/loglytics
php artisan migrate
# Visit /log-viewer

Production Setup

// config/loglytics.php
return [
    'route' => [
        'prefix' => 'admin/logs',
        'middleware' => ['web', 'auth', 'admin'],
    ],
    'authorization' => [
        'enabled' => true,
        'gate' => 'viewLogViewer',
    ],
    'cache' => [
        'enabled' => true,
        'ttl' => 120,
    ],
];

Customizing Views

php artisan vendor:publish --tag=loglytics-views
# Edit resources/views/vendor/loglytics/*.blade.php

Package Structure

fqathf/loglytics/
├── config/loglytics.php
├── database/migrations/
├── resources/views/
├── routes/web.php
├── src/
│   ├── Http/Controllers/LogViewerController.php
│   ├── Models/LogBugStatus.php
│   ├── Services/LogViewerService.php
│   └── LogViewerServiceProvider.php
├── CHANGELOG.md
├── CONTRIBUTING.md
└── README.md

Security

If you discover a security vulnerability, please report it through GitHub Security Advisories instead of using the issue tracker.

License

MIT License. See LICENSE for details.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-07-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固