Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Logs Rotate Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  1. Config merge semantics. Laravel's 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.
  2. Default behavior preservation. Confirm the default keeps rotating all files (threshold 0 / disabled) so upgrading does not silently change rotation behavior for teams that never touch config. Silent behavior changes on a minor bump would be a governance problem, not just a technical one.
  3. Naming/units ambiguity. "File size" needs a defined unit and comparison semantics (bytes vs. human-readable strings, < 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?

Integration Approach

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:

  • Existing published config files will lack the new key — validate the code path with the key missing (this is the regression test worth writing).
  • The rotation behavior for currently-configured channels must be identical before and after the upgrade unless a threshold is deliberately set.

Sequencing.

  1. Confirm version constraints against the target Laravel/PHP matrix; read the 2.8.0 → 2.9.0 diff (it is one PR).
  2. Upgrade in a staging environment only, leaving config untouched, and diff a rotation cycle's output against the prior version — expect no change.
  3. Decide the policy: which channels and environments get a minimum-size threshold, and what value. Low-traffic services and non-production environments are the obvious first candidates; high-volume production channels likely need no threshold.
  4. Publish/merge the new config key explicitly rather than relying on defaults, and document the chosen value with a rationale comment.
  5. Promote to production with the scheduler run observed once, then leave it alone.

Operational Impact

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.

  • Silent no-op: command not registered, scheduler not running (missing cron/queue worker), or path misconfigured — logs grow until the disk fills. This is the highest-impact failure and it is quiet. Add disk-usage alerting as a backstop independent of the package.
  • Config drift: published config missing the new key; behavior depends on defensive defaulting (see Technical Evaluation).
  • Concurrent execution in multi-instance or overlapping-schedule setups, producing partially written archives.
  • Over-aggressive retention deleting logs needed for an incident investigation — retention policy is a compliance-adjacent decision, not just a housekeeping one.
  • Ephemeral filesystem in containerized deployments, where rotation succeeds but the rotated files vanish with the pod, making the effort pointless and the config misleading.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource