-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Jiordi Viera edited this page Nov 10, 2024
·
3 revisions
Welcome to the Laravel Log Cleaner wiki! This wiki provides comprehensive documentation about installing, configuring, and using the Laravel Log Cleaner package.
- PHP 7.4 or higher
- Laravel 8.x or higher
- Composer
composer require jiordiviera/laravel-log-cleaner
- Add the package to your
composer.json
:
{
"require": {
"jiordiviera/laravel-log-cleaner": "^1.0",
}
}
- Run
composer update
## Basic Usage
### Using the Command
```bash
php artisan logs:clear
Add to your App\Console\Kernel
:
protected function schedule(Schedule $schedule)
{
$schedule->command('logs:clear')->daily();
}
php artisan logs:clear --days=30
Ensure your web server has write permissions to the log directory:
chmod -R 755 storage/logs
chown -R www-data:www-data storage/logs
For very large log files, you might want to increase PHP's memory limit in your php.ini
:
memory_limit = 512M
- Fork the repository
- Clone your fork
- Install dependencies:
composer install
- Run tests:
php artisan test
- Fork the repository
- Create a new branch for your feature
- Add tests for new functionality
- Submit a pull request
A: The package uses file locking to ensure safe operations on open log files.
A: Yes, use the excluded_files
config option or the exclude()
method programmatically.
A: Yes, the package can handle .gz
compressed log files automatically.
A: The package implements retry mechanisms and logs failures for monitoring.
For more information or support: