Download the PHP package mifesta/laravel-log-cleaner without Composer
On this page you can find all versions of the php package mifesta/laravel-log-cleaner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-log-cleaner
Laravel Log Cleaner
Artisan command and facade that delete old Laravel log files.
The package release matches the major Laravel version. composer require selects the newest release that fits the Laravel version already installed in the project.
| Laravel | Package constraint | PHP |
|---|---|---|
| 5.5 – 5.8 | ^5.5 |
>=7.0 |
| 6 | ^6.0 |
^7.2 |
| 7 | ^7.0 |
^7.2.5 |
| 8 | ^8.0 |
^7.3\|^8.0 |
| 9 | ^9.0 |
^8.0 |
| 10 | ^10.0 |
^8.1 |
| 11 | ^11.0 |
^8.2 |
| 12 | ^12.0 |
^8.2 |
| 13 | ^13.0 |
^8.3 |
Release 1.0.1 remains available for existing 1.* constraints. It does not include these fixes.
Installation
Laravel 5.5 and newer discover the service provider and the log:clear command. No edit to app/Console/Kernel.php is required.
Usage
Delete every *.log file in storage/logs:
Keep entries from the last 14 days. A file dated exactly 14 days ago is kept; older files are deleted.
Clean another directory, or pass a log file to clean the directory that contains it:
The same operations are available through Mifesta\LogCleaner\Facades\Cleaner. Calls share one instance.
Inside storage/logs the cleaner handles:
- daily files
*-YYYY-MM-DD.log, using the date in the file name - other
*.logfiles, using[YYYY-MM-DD HH:MM:SS]headers or JSON lines with adatetimefield - files without those dates, using the file modification time when
--rotateis set
Only the selected directory is scanned. Subdirectories, hidden files, and files that do not end in .log stay in place. Omitting --rotate deletes every *.log file in the directory. A missing path or a negative rotate value stops the command before anything is deleted.
Tests
Credits
Security
Report security issues to [email protected].
License
MIT. Copyright (c) 2019-2026 Sergei Gruzdov \[email protected]\.
All versions of laravel-log-cleaner with dependencies
illuminate/console Version ^13.0
illuminate/filesystem Version ^13.0
illuminate/support Version ^13.0