cesargb/laravel-logs-rotate
Automatically rotate Laravel log files. This package compresses and archives daily logs, removes old files by age or count, and integrates with the scheduler. Simple config keeps storage tidy without manual cleanup.
Architecture fit. cesargb/laravel-logs-rotate is a narrow, single-responsibility Laravel package: it wraps log file rotation (size/date-based), optional compression, and retention cleanup behind a facade and an artisan command, typically driven by the scheduler. It sits in the "operational hygiene" layer of a Laravel app — no persistence, no request-path involvement, no service container coupling beyond config and the console kernel. That is a good architectural fit for teams that want rotation handled in-app rather than depending on host-level logrotate, which is often unavailable or unmanaged in containerized/PaaS deployments where the filesystem is ephemeral or the platform owns the daemon.
Release 2.9.0 assessment. The change adds a minimum file size option so small log files are not rotated. This is a small, additive, backward-compatible feature on a minor version bump — the correct semver signal. TPM-relevant value: it removes a real operational annoyance (rotation churn and archive clutter on low-traffic services and on apps with many small channel files), and it reduces needless compression/IO on idle environments. There are no breaking changes, no deprecations, and no new runtime dependencies. Treat this as a low-risk upgrade, not a re-evaluation trigger.
Integration feasibility. High. It is a Composer package with a publishable config, so the integration surface is composer require, vendor:publish, one scheduled command registration, and a config file. The only non-trivial work is deciding rotation policy per channel and validating it in a non-production environment.
Technical risk. Low overall, with three specific caveats:
mergeConfigFrom merges top-level keys shallowly. A newly published key such as the minimum-size threshold will not appear in an already-published config/logrotate.php. Whether that is benign depends entirely on whether the package reads the value with a safe default (e.g. config('logrotate.min_size', 0)) or assumes presence. If the former, behavior is unchanged post-upgrade; if the latter, absence could mean "no minimum" (fine) or a type error (not fine). This must be confirmed before rollout.< vs. <=, checked before or after the size trigger). Ambiguity here translates directly into incident confusion later.Key questions. Does the new option default to disabled, and is it read defensively when absent from a published config? Is the threshold expressed in bytes or a parsable string, and does it compose predictably with the existing size and date rotation rules? Does the minimum-size gate apply to the date-based rotation path as well, or only size-based? Is the config key documented in the README and covered by tests? What is the package's release cadence and maintainer concentration (single-maintainer risk is the dominant long-term concern for a package of this size)? Does the current pinned version have any open advisories?
Stack fit. Assumes Laravel 9/10/11-era conventions (service provider, facade, artisan command, scheduler). Verify the composer.json Laravel and PHP constraints against the target application's version before planning the work — this is the single most common blocker for small utility packages and the one most likely to force an alternative.
Migration path. Effectively none required. There is no data migration, no schema change, no API surface removal. The upgrade is composer update cesargb/laravel-logs-rotate, then a decision on whether to adopt the new option. Adopting it is a config edit, not a code change.
Compatibility. Backward compatible by design. Two things to check rather than assume:
Sequencing.
Maintenance. Minimal and periodic: version bumps, an occasional config review, and confirming the scheduled command still runs after Laravel/framework upgrades. The 2.9.0 feature actually reduces maintenance load by cutting small-file churn and archive sprawl on quiet services.
Support. Low support surface — failures are visible (missing or oversized logs, disk growth) rather than subtle. The main support burden is institutional knowledge: someone must know that rotation is handled in-app, not by the host, so it is not double-configured or accidentally disabled during container/host changes. The new minimum-size option adds one more knob that should be documented in the team runbook, not just the config file.
Scaling. Scales with log volume and file count, not with request rate. Rotation is a discrete scheduled job; on hosts with many channels or very large files, compression is the expensive part and can spike CPU/IO if the job coincides with peak traffic. The minimum-size gate is mildly favorable here — fewer small files means fewer compression operations. Confirm the scheduler is not running the command on every app instance in a multi-instance deployment, or the job will race on the same files.
Failure modes.
Ramp-up. Low — an engineer familiar with Laravel can integrate and validate this in well under a day, most of which is staging verification rather than implementation. The real ramp-up cost is policy, not code: agreeing rotation thresholds and retention windows per environment, and writing them down. Budget a short review with whoever owns observability/on-call so the retention window aligns with incident-response needs rather than being set arbitrarily.
How can I help you explore Laravel packages today?