darwinnatha / purge-logs
a simple package for deleting logs by keeping those at a given period
Installs: 159
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/darwinnatha/purge-logs
Requires
- php: ^8.0
- illuminate/console: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- orchestra/testbench: ^7.46
- pestphp/pest: ^1.23
- pestphp/pest-plugin-laravel: ^1.4
README
This package allows you to delete logs, keeping only those from a given period.
Installation
To install this package, you should add the package to your project via Composer.
composer require darwinnatha/pure-logs
Usage
To use this package, publish the configuration file.
php artisan vendor:publish --provider="Darwinnatha\PurgeLogs\PurgeLogsServiceProvider"
Then, you can purge the logs by running the following command.
php artisan logs:purge
Alternatively, if you want to specify the number of days to retain, you can use the keep-days argument.
php artisan logs:purge --keep-days=7
Configuration
You can configure the number of days to retain by editing the config/purge-logs.php file.
return [ 'retention_period' => 7, ];