gboquizosanchez/filament-log-viewer

Filament Log Viewer

Package info

github.com/gboquizosanchez/filament-log-viewer

Homepage

pkg:composer/gboquizosanchez/filament-log-viewer

Statistics

Installs: 153 476

Dependents: 3

Suggesters: 0

Stars: 25

Open Issues: 0

2.3.0 2026-04-07 12:29 UTC

Requires

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT a32df2ae9d9512c166ac1a93eed57c9677294024

  • GermΓ‘n Boquizo SΓ‘nchez <germanboquizosanchez.woop@gmail.com>

laravellog-viewerfilament


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.