leobsst / filament-log-manager
Read Laravel logs from the Filament admin panel
Fund package maintenance!
LEOBSST
Installs: 851
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/leobsst/filament-log-manager
Requires
- php: ^8.2
- filament/filament: ^4.0
- illuminate/contracts: ^11.0||^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^10.16
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
This package is auto-updated.
Last update: 2025-10-29 11:12:06 UTC
README
Read Laravel logs from the Filament v4 admin panel.
Features
- Syntax highlighting
- Light/Dark mode
- Quickly jump between start and end of the file
- Refresh log contents
- Delete log files
- Search multiple files in multiple directories
- Ignored file patterns
Available languages
- 🇬🇧 English
- 🇫🇷 French
- 🇪🇸 Spanish
Installation
Requirements
- PHP 8.2 or higher
- Laravel 11.x or 12.x
- Filament 4.x
- Pest 3.x for testing (dev dependency)
You can install the package via composer:
composer require leobsst/filament-log-manager
Important
If you have not set up a custom theme and are using Filament Panels follow the instructions in the Filament Docs first.
After setting up a custom theme add the plugin's views to your theme css file or your app's css file if using the standalone packages.
/* PLUGIN STYLE */ @import '../../../../vendor/leobsst/filament-log-manager/resources/css/index.css'; /* COMPILE TAILWINDCSS DIRECTIVES IN VIEWS */ @source '../../../../vendor/leobsst/filament-log-manager/resources/views/**/*.blade.php';
Usage
Add the Leobsst\FilamentLogManager\FilamentLogManager to your panel config.
use Leobsst\FilamentLogManager\FilamentLogManager; class AdminPanelProvider extends PanelProvider { public function panel(Panel $panel): Panel { return $panel // ... ->plugin( FilamentLogManager::make() ); } }
Configuration
Customizing the navigation
FilamentLogManager::make() ->navigationGroup('System') ->navigationParentItem('Tools') ->navigationLabel('Logs') ->navigationIcon('heroicon-o-server') ->activeNavigationIcon('heroicon-s-server') ->navigationBadge('+10') ->navigationBadgeColor('danger') ->navigationBadgeTooltip('New logs available') ->navigationSort(1) ->title('Application Logs') ->slug('logs')
Customizing the log search
FilamentLogManager::make() ->logDirs([ storage_path('logs'), // The default value ]) ->excludedFilesPatterns([ '*2025*' ])
Authorization
If you would like to prevent certain users from accessing the logs page, you should add a authorize callback in the FilamentLogManager chain.
FilamentLogManager::make() ->authorize( fn () => auth()->user()->hasRole('admin') )
You can also prevent certain users from performing certain actions.
FilamentLogManager::make() ->canDeleteUsing( fn () => auth()->user()->hasRole('admin') )
FilamentLogManager::make() ->canDownloadUsing( fn () => auth()->user()->hasRole('support') )
Customizing the log page
To customize the log page, you can extend the Leobsst\FilamentLogManager\Pages\Logs page and override its methods.
use Leobsst\FilamentLogManager\Pages\Logs as BaseLogs; class Logs extends BaseLogs { // Your implementation }
use App\Filament\Pages\Logs; FilamentLogManager::make() ->viewLog(Logs::class)
You can publish the config file with:
php artisan vendor:publish --tag="filament-log-manager-config"
This is the contents of the published config file:
return [ //======================================= // LOG EDITOR INTERFACE //======================================= /** * Maximum amount of lines that editor will render. */ 'max_lines' => 45, /** * Minimum amount of lines that editor will render. */ 'min_lines' => 10, /** * Editor font size. */ 'font_size' => 12, //======================================= // FILE MANAGEMENT //======================================= /** * Set max file size reader * Default 5242880 = 5 MB */ 'max_file_size' => 5242880, //======================================= // PAGE FORM //======================================= /** * Limit the number of results returned from the search. * If set to -1 or null or 0 there is no limit. */ 'limit' => -1, ];
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.