PHPackages                             daz9e/laravel-log-compressor - 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. daz9e/laravel-log-compressor

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

daz9e/laravel-log-compressor
============================

Lets you compress .log files in your laravel app by command or schedule.

1.3(1y ago)0461MITPHPPHP ^7.4|^8.0

Since Jul 23Pushed 1y agoCompare

[ Source](https://github.com/daz9e/laravel-log-compressor)[ Packagist](https://packagist.org/packages/daz9e/laravel-log-compressor)[ RSS](/packages/daz9e-laravel-log-compressor/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

Log Compression Command
=======================

[](#log-compression-command)

Usage
-----

[](#usage)

Run the command to compress log files older than a specified number of days and delete old compressed logs.

```
php artisan logs:compress [days]
```

- **`days`** (optional): Number of days to keep logs uncompressed. Defaults to `LOG_COMPRESS_DAYS` in `.env` or `2` days.

### Example

[](#example)

```
php artisan logs:compress 5
```

Compresses logs older than 5 days and deletes `.gz` files older than 14 days (configurable in `config/logging.php`).

Configuration
-------------

[](#configuration)

In `config/logging.php`:

- **`compress_days`**: Days to keep logs uncompressed (default: `2`). Override via `.env`: ```
    LOG_COMPRESS_DAYS=5
    ```
- **`logging.channels.daily.days`**: Retention period for compressed logs (default: `14` days).

Scheduling
----------

[](#scheduling)

Scheduled to run daily in `routes/console.php`:

```
Schedule::command('logs:compress')->daily();
```

Ensure the Laravel scheduler is set up:

```
* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
```

###  Health Score

30

—

LowBetter than 61% of packages

Maintenance48

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

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 ~1 days

Total

4

Last Release

386d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad1e12cb544bfce8b443e0d8882e62df7632c65f72baa13711702be30ae8188?d=identicon)[daz9e](/maintainers/daz9e)

---

Tags

compressionlaravelloggingphp

### Embed Badge

![Health badge](/badges/daz9e-laravel-log-compressor/health.svg)

```
[![Health](https://phpackages.com/badges/daz9e-laravel-log-compressor/health.svg)](https://phpackages.com/packages/daz9e-laravel-log-compressor)
```

###  Alternatives

[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

137236.2k8](/packages/statamic-rad-pack-runway)[open-telemetry/opentelemetry-auto-laravel

OpenTelemetry auto-instrumentation for Laravel

593.1M9](/packages/open-telemetry-opentelemetry-auto-laravel)[nightowl/agent

NightOwl monitoring agent — collects telemetry from laravel/nightwatch and writes to PostgreSQL

915.8k](/packages/nightowl-agent)[duncanmcclean/statamic-cargo

Comprehensive e-commerce addon for Statamic. Build bespoke e-commerce sites without the complexity.

3622.8k](/packages/duncanmcclean-statamic-cargo)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21327.3k4](/packages/ecotone-laravel)

PHPackages © 2026

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