Access laravel log through Filament admin panel
Features
- Syntax highlighting
- Quickly jump between start and end of the file
- Refresh log contents
- Clear log contents
- Search multiple files in multiple directories New in v1.1.0
- Ignore file patterns New in v1.1.0
Support Filament
Installation
You can install the package via composer:
composer require saade/filament-laravel-log
Usage
Just install the package and you're ready to go!
Configuration
You can publish the config file with:
php artisan vendor:publish --tag="filament-laravel-log-config"
This is the contents of the published config file:
return [
/**
* Secure the page behind a custom policy.
*/
'authorization' => false,
/**
* The directory(ies) containing the log files.
*/
'logsDir' => [
storage_path('logs'),
],
/**
* Files to ignore when searching for log files.
* Accepts wildcards eg: *.log
*/
'exclude' => [
//
],
/**
* Navigation group.
*/
'navigationGroup' => 'System',
/**
* Navigation icon.
*/
'navigationIcon' => 'heroicon-o-document-text',
/**
* Navigation label.
*/
'navigationLabel' => 'Logs',
/**
* Navigation slug.
*/
'slug' => 'system-logs',
/**
* Maximum amount of lines that editor will render.
*/
'maxLines' => 50,
/**
* Minimum amount of lines that editor will render.
*/
'minLines' => 10,
/**
* Editor font size.
*/
'fontSize' => 12
];
Authorization
If you would like to prevent certain users from accessing your page, you should enable authorization
in config
// config/filament-laravel-log.php
return [
/**
* Secure the page behind a custom policy.
*/
'authorization' => true,
];
and register an authorization callback inside of a ServiceProvider::boot()
method.
// app/Providers/AppServiceProvider.php
public function boot()
{
ViewLog::can(function (User $user) {
return $user->role === Role::Admin;
});
}
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
- Saade
- Laravel Forge - for the editor theme
- ryangjchandler's Filament Log - based of for the authorization and multiple log files feature
- All Contributors
License
The MIT License (MIT). Please see License File for more information.