PHPackages                             hedii/artisan-log-cleaner - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. hedii/artisan-log-cleaner

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

hedii/artisan-log-cleaner
=========================

An artisan command to clear laravel log files

8.0.0(1y ago)4161.6k↓22.6%14MITPHPPHP ^8.2CI passing

Since Sep 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/hedii/artisan-log-cleaner)[ Packagist](https://packagist.org/packages/hedii/artisan-log-cleaner)[ RSS](/packages/hedii-artisan-log-cleaner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (13)Used By (0)

[![Build Status](https://github.com/hedii/artisan-log-cleaner/workflows/Tests/badge.svg)](https://github.com/hedii/artisan-log-cleaner/actions)[![Total Downloads](https://camo.githubusercontent.com/f308b3b39cf1920f591849be3edf27d3cb68ab8570e4efdc29476a7aa294dc43/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6172746973616e2d6c6f672d636c65616e65722f646f776e6c6f616473)](//packagist.org/packages/hedii/artisan-log-cleaner)[![License](https://camo.githubusercontent.com/d42db71d1d98b24534e8965ee37709d97bf655fcc291ae011c5f32ae538fccc0/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6172746973616e2d6c6f672d636c65616e65722f6c6963656e7365)](//packagist.org/packages/hedii/artisan-log-cleaner)[![Latest Stable Version](https://camo.githubusercontent.com/e0cc5d6acb1a5f3f6ffcb98c76a256ac201af246a82ce38430b61eb1dba1129b/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6172746973616e2d6c6f672d636c65616e65722f76)](//packagist.org/packages/hedii/artisan-log-cleaner)

Artisan Log Cleaner
===================

[](#artisan-log-cleaner)

An artisan command to clear laravel log files

Table of contents
-----------------

[](#table-of-contents)

- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
    - [Clear all log files](#clear-all-log-files)
    - [Clear all log files except the last one](#clear-all-log-files-except-the-last-one)
- [Testing](#testing)
- [License](#license)

Installation
------------

[](#installation)

Install via [composer](https://getcomposer.org/doc/00-intro.md)

```
composer require hedii/artisan-log-cleaner
```

Add it to your providers array in `config/app.php`:

```
Hedii\ArtisanLogCleaner\ArtisanLogCleanerServiceProvider::class
```

Usage
-----

[](#usage)

### Clear all log files

[](#clear-all-log-files)

Run this command to clear all log files in the log directory (`storage/logs`):

```
php artisan log:clear

```

### Clear all log files except the last one

[](#clear-all-log-files-except-the-last-one)

Run this command to clear all log files except the last one in the log directory (`storage/logs`):

```
php artisan log:clear --keep-last

```

### Clear all log files except specified file names

[](#clear-all-log-files-except-specified-file-names)

Run this command to clear all log files except the specified files in the option. Specify file name without extension. Can be combined with `--keep-last` option.

```
php artisan log:clear --keep="keptLog"

```

### Automated cleanup of log files

[](#automated-cleanup-of-log-files)

Add this to the App\\Console\\Kernel schedule method to ensure daily cleanup of old log files

```
$schedule->command('log:clear --keep-last')->daily();

```

Testing
-------

[](#testing)

```
composer test

```

License
-------

[](#license)

hedii/artisan-log-cleaner is released under the MIT Licence. See the bundled [LICENSE](https://github.com/hedii/artisan-log-cleaner/blob/master/LICENSE.md) file for details.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance45

Moderate activity, may be stable

Popularity43

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 82.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~283 days

Recently: every ~277 days

Total

12

Last Release

427d ago

Major Versions

3.0.0 → 4.0.02020-09-21

4.1.0 → 5.0.02022-03-06

5.0.0 → 6.0.02023-02-20

6.1.0 → 7.0.02024-03-22

7.0.0 → 8.0.02025-03-18

PHP version history (8 changes)1.0.0PHP &gt;=7.0

2.0.0PHP ^7.2

3.0.0PHP ^7.2.5

4.0.0PHP ^7.3

4.1.0PHP ^7.3|^8.0

5.0.0PHP ^8.0

6.0.0PHP ^8.1

7.0.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4a5db1cfc95de95128aba94b6f26a69d543e7f1e95f5f9afcdaf7e1db836fe1?d=identicon)[hedii](/maintainers/hedii)

---

Top Contributors

[![hedii](https://avatars.githubusercontent.com/u/5358048?v=4)](https://github.com/hedii "hedii (23 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")[![adhityairvan](https://avatars.githubusercontent.com/u/3985647?v=4)](https://github.com/adhityairvan "adhityairvan (1 commits)")[![fixer112](https://avatars.githubusercontent.com/u/25584514?v=4)](https://github.com/fixer112 "fixer112 (1 commits)")[![martinjoiner](https://avatars.githubusercontent.com/u/1795947?v=4)](https://github.com/martinjoiner "martinjoiner (1 commits)")

---

Tags

artisan-commandcleanerlaravelloglogphplaravelartisanhediiartisan-log-cleaner

### Embed Badge

![Health badge](/badges/hedii-artisan-log-cleaner/health.svg)

```
[![Health](https://phpackages.com/badges/hedii-artisan-log-cleaner/health.svg)](https://phpackages.com/packages/hedii-artisan-log-cleaner)
```

###  Alternatives

[laravel/wayfinder

Generate TypeScript representations of your Laravel actions and routes.

1.7k4.1M69](/packages/laravel-wayfinder)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[inspector-apm/inspector-laravel

Code Execution Monitoring, built for developers.

2332.0M2](/packages/inspector-apm-inspector-laravel)[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1333.4M10](/packages/hedii-laravel-gelf-logger)[nunomaduro/laravel-console-menu

Laravel Console Menu is an output method for your Laravel/Laravel Zero commands.

815412.0k48](/packages/nunomaduro-laravel-console-menu)[tehwave/laravel-achievements

Simple, elegant Achievements the Laravel way

7012.8k](/packages/tehwave-laravel-achievements)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
