承接 gboquizosanchez/filament-log-viewer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

gboquizosanchez/filament-log-viewer

Composer 安装命令:

composer require gboquizosanchez/filament-log-viewer

包简介

Filament Log Viewer

README 文档

README

Log Viewer

gboquizosanchez/filament-log-viewer

Log Viewer plugin for Filament panels

Latest Stable Version Total Downloads PHP License: MIT Tests

Browse, filter, and manage your Laravel log files directly inside your Filament panel.

Overview

This plugin integrates a full-featured log viewer into any Filament panel. Browse log entries by level, filter by date, and inspect stack traces — all without leaving your admin interface.

Based on ARCANEDEV LogViewer.

Panel

Version compatibility

Plugin Filament
1.x 3.x
2.x 4.x – 5.x

Important

Version 1.x won't receive any further updates.

📦 Installation

composer require gboquizosanchez/filament-log-viewer

Register the plugin in your panel provider (app/Providers/Filament/AdminPanelProvider.php):

->plugin(\Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make())

Optionally, publish the configuration file:

php artisan vendor:publish --provider="Boquizo\FilamentLogViewer\FilamentLogViewerServiceProvider"

Important

Filament v4+ requires a custom theme. Follow the Filament docs to set one up, then add this line to your theme's CSS source:

@source '../../../../vendor/gboquizosanchez/filament-log-viewer/resources/views/**/*.blade.php';

🔧 Drivers

By default, the plugin reads from the LOG_CHANNEL defined in your .env. You can override this with a dedicated environment variable:

FILAMENT_LOG_VIEWER_DRIVER=raw
Driver Description
daily Default — mirrors your LOG_CHANNEL=daily setting
single Standard Laravel single-file driver
raw Shows all log files; only available via FILAMENT_LOG_VIEWER_DRIVER

If FILAMENT_LOG_VIEWER_DRIVER is not set, the plugin falls back to LOG_CHANNEL.

⚙️ Configuration

All plugin options are chainable:

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->navigationGroup('System')
        ->navigationSort(2)
        ->navigationIcon(Heroicon::OutlinedDocumentText)
        ->navigationLabel('Log Viewer')
        ->timezone('Europe/Madrid')
        ->authorize(fn (): bool => auth()->user()->can('view-logs')),
])

View in modal

By default, clicking "View" opens the log in a full page. You can enable modal mode instead.

Via .env:

FILAMENT_LOG_VIEWER_VIEW_IN_MODAL=true

Or programmatically:

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->viewInModal(),
])

When using modal view, you may want to block direct URL access to the ViewLog page by registering a custom page that denies access:

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->viewInModal()
        ->viewLog(\App\Filament\LogViewer\Pages\ViewLogDenied::class),
])

🧩 Custom Pages

You can extend the built-in pages to add your own behaviour.

Custom log list — e.g. auto-refresh every 30 seconds:

// app/Filament/Pages/CustomListLogs.php

namespace App\Filament\Pages;

use Boquizo\FilamentLogViewer\Pages\ListLogs as BaseListLogs;
use Filament\Tables\Table;

class CustomListLogs extends BaseListLogs
{
    protected static ?string $navigationLabel = 'Application Logs';
    protected static ?string $navigationGroup = 'Monitoring';

    public function table(Table $table): Table
    {
        return parent::table($table)
            ->defaultPaginationPageOption(25)
            ->poll('30s');
    }
}

Custom log viewer — e.g. add an export action:

// app/Filament/Pages/CustomViewLog.php

namespace App\Filament\Pages;

use Boquizo\FilamentLogViewer\Pages\ViewLog as BaseViewLog;
use Filament\Actions\Action;
use Filament\Support\Icons\Heroicon;

class CustomViewLog extends BaseViewLog
{
    protected function getHeaderActions(): array
    {
        return array_merge(parent::getHeaderActions(), [
            Action::make('export')
                ->label('Export to CSV')
                ->icon(Heroicon::OutlinedArrowDownTray)
                ->action(fn () => $this->exportToCsv()),
        ]);
    }

    private function exportToCsv(): void
    {
        // Custom export logic
    }
}

Then register your custom pages in the plugin:

->plugins([
    \Boquizo\FilamentLogViewer\FilamentLogViewerPlugin::make()
        ->listLogs(\App\Filament\Pages\CustomListLogs::class)
        ->viewLog(\App\Filament\Pages\CustomViewLog::class)
        ->navigationGroup('System')
        ->navigationSort(2)
        ->navigationIcon(Heroicon::DocumentText)
        ->navigationLabel('System Logs')
        ->timezone('Pacific/Auckland')
        ->authorize(fn (): bool => auth()->user()->hasAnyRole(['admin', 'developer'])),
])

🧪 Testing

composer test

Contributing

Contributions are welcome!

  • 🐛 Report bugs via GitHub Issues
  • 💡 Suggest features or improvements
  • 🔧 Submit pull requests with fixes or enhancements

Credits

📄 License

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

gboquizosanchez/filament-log-viewer 适用场景与选型建议

gboquizosanchez/filament-log-viewer 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 152.05k 次下载、GitHub Stars 达 25, 最近一次更新时间为 2025 年 04 月 24 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「log-viewer」 「filament」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 gboquizosanchez/filament-log-viewer 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gboquizosanchez/filament-log-viewer 我们能提供哪些服务?
定制开发 / 二次开发

基于 gboquizosanchez/filament-log-viewer 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 152.05k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 25
  • 点击次数: 13
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 25
  • Watchers: 2
  • Forks: 12
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-24