achyutn / filament-log-viewer
A Filament package to view and manage Laravel logs.
Requires
- php: >=8.2
- filament/filament: ^5
- livewire/livewire: ^4
- phiki/phiki: ^2.0
Requires (Dev)
- larastan/larastan: ^3.8
- laravel/pint: ^1.27
- orchestra/testbench: ^10.9
- pestphp/pest: ^4.3
- pestphp/pest-plugin-laravel: ^4.0
- pestphp/pest-plugin-livewire: ^4.1
- phpstan/phpstan: ^2.1
- rector/rector: ^2.3
- dev-filament-v5
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6
- 1.5.3
- v1.5.2
- v1.5.1
- v1.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.0
- v0.7
- v0.6
- v0.5.3
- v0.5.2
- v0.5.1
- v0.5.0
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.1
- v0.3.0
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
- v0.0.1
- dev-filament-v4
- dev-translation-docs
- dev-v5-to-v4
- dev-add-model-labels
- dev-max-size-cast
- dev-pr-branch
- dev-feature/should-register-navigation
- dev-refactor
- dev-clear-log-option
- dev-parsing-fixed
- dev-filament-v3
This package is auto-updated.
Last update: 2026-04-01 11:20:20 UTC
README
A Filament plugin to read and display Laravel log files in a clean, searchable table with stack traces and filtering.
Refer to version compatibility table below to ensure you are using the correct version of this package with your Filament installation.
Installation
composer require achyutn/filament-log-viewer
Register the plugin inside your Filament panel:
use AchyutN\FilamentLogViewer\FilamentLogViewer; return $panel ->plugins([ FilamentLogViewer::make(), ]);
Usage
After installation, visit /logs in your Filament panel. You will see a table of log entries.
Configuration
You can configure the maximum file size limit for log files to be loaded and displayed. This helps prevent performance issues with very large log files.
The default file size limit is set to 2 MB. To override these settings, you can set environment variables in your .env file:
LOG_MAX_SIZE_KB=20480
LOG_ENABLE_DELETE=false
Set LOG_ENABLE_DELETE=false in production to disable the Clear Logs button and protect log files from accidental deletion.
Or, you can publish the configuration file and update the max_log_file_size value as needed:
php artisan vendor:publish --tag=filament-log-viewer-config
Then, in your published config/filament-log-viewer.php file:
return [ // Set max file size to 20 MB 'max_log_file_size' => env('LOG_MAX_SIZE_KB', 20480), // Disable deleting logs from the UI 'enable_delete' => env('LOG_ENABLE_DELETE', false), ];
Table Columns
- Log Level – Badge with color mapped from log level
- Environment (Toggleable) – Application environment (
local,production, etc.) - File (Toggleable) – Log file name (e.g.,
laravel.log) - Message – Short summary of the log
- Occurred – Human-readable date/time
Click the view action to inspect stack traces.
Mail Preview
If your logs contain mail messages, you can preview them directly from the table. You can click on Mail tab which is visible only if mail are present.
Filters
Log Levels
You can filter the logs according to log level. The filters are available as tabs above the table:
Date
You can filter logs by date using the date picker in the top right corner of the table. This allows you to select a specific date range to view logs.
Toggle Columns
You can toggle the visibility of the Environment and File columns by clicking the eye icon in the top right corner of the table.
Authorization
You can make a boolean check to authorize the log viewer. It will be helpful if you want to show/hide the log viewer for certain cases.
Example
You simply return a boolean or Closure which evaluates to a boolean.
FilamentLogViewer::make() ->authorize(true); // or FilamentLogViewer::make() ->authorize(fn (): bool => auth()->user()->is_admin);
If you are using filament-sheild or any other external services for authorization, you can use a Closure with permission check:
FilamentLogViewer::make() ->authorize(fn (): bool => auth()->check() && auth()->user()->can('View:LogTable'));
Extending
You can customize navigation label, icon, sort, etc. using:
use AchyutN\FilamentLogViewer\FilamentLogViewer; FilamentLogViewer::make() ->authorize(fn () => auth()->check()) ->registerNavigation(true) ->navigationGroup('System') ->navigationIcon('heroicon-o-document-text') ->navigationLabel('Log Viewer') ->navigationSort(10) ->navigationUrl('/logs') ->pollingTime(null); // Set to null to disable polling
Set ->registerNavigation(false) if you want to hide Log Viewer from the sidebar while still linking to it directly (for example, from a custom dashboard action).
Localization
Filament Log Viewer includes built-in translations for:
- English
- Arabic
- German
- Spanish
- Persian
- French
- Hebrew
- Italian
- Portuguese (Portugal)
- Portuguese (Brazil)
Translations are applied automatically based on your application's current locale.
Missing your language? Feel free to submit a PR to add it!
Filament Compatibility
| Version | Filament Version |
|---|---|
^2.x |
Filament v5 |
^1.x |
Filament v4 |
^0.x |
Filament v3 |
Make sure you're using the appropriate version of this package for your Filament installation.
License
This package is open-sourced software licensed under the MIT license.
Changelog
See the CHANGELOG for details on changes made in each version.
Contributing
Contributions are welcome! Please create a pull request or open an issue if you find any bugs or have feature requests.
Support
If you find this package useful, please consider starring the repository on GitHub to show your support.