This package will help monitor a laravel application disk metrics.
You can install the package via composer:
composer require neoniche/laravel-app-monitor
You can publish and run the migrations with:
php artisan vendor:publish --tag="app-monitor-migrations"
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="app-monitor-config"
This is the contents of the published config file:
return [
/**
* The name of the disk you want to monitor.
* default: 'local'
*/
'disk_names' => [
'local',
],
];
You should set up a schedule to run the command app-monitor:log
to record the disk metrics.
// app/Console/Kernel.php
use Neoniche\AppMonitor\Commands\AppMonitorCommand;
class Kernel extends ConsoleKernel
{
protected function schedule(Schedule $schedule)
{
$schedule->command(AppMonitorCommand::class)->daily();
}
}
Optionally, you can publish the views using
php artisan vendor:publish --tag="app-monitor-views"
If you wish to view the statistics that is logged to the database in a browser. You should add the macro below to your routes file.
```php
// in a routes files
Route::appMonitor('custom-monitor-url');
Now, you can see all statics when browsing /custom-monitor-url/disk-file-logs. You can change the custom-monitor-url to whatever suits you. We highly recommand using the auth middleware for this route, so guests can't see any data regarding your disks.
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.