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
Php Log Rotation

Php Log Rotation Laravel Package

cesargb/php-log-rotation

A framework-agnostic PHP library for rotating log files by size or time, with automatic gzip/bzip2 compression, retention limits, and cleanup of old logs. Works standalone or with Laravel, PSR-3 loggers, and custom handlers.

Deep Wiki
Context7

cesargb/php-log-rotation is a lightweight, framework-agnostic PHP library for rotating log files without external dependencies. It keeps logs manageable by rotating files when they reach a configured size limit, retaining a limited number of backups, and optionally compressing rotated logs.

  • Rotate by maximum file size
  • Limit retained backups with max files
  • Optional Gzip compression
  • Custom filename and path handling
  • Simple Composer installation
Frequently asked questions about Php Log Rotation
Is cesargb/php-log-rotation a Laravel package?
No. It is a framework-agnostic PHP utility class for rotating log files, not a Laravel package with a service provider, config file, facade, or publishable assets. Laravel integration is manual and typically happens through a console command, scheduled job, or custom logging adapter.
How do I install cesargb/php-log-rotation with Composer?
Install it with Composer using the package name cesargb/php-log-rotation. Because the repository and release metadata are not clearly verified in the provided context, confirm the Packagist entry, tags, changelog, and PHP version constraints before adding it to a production application.
Does this package replace Laravel's daily log channel or Monolog RotatingFileHandler?
Usually no. Laravel already ships with Monolog and a daily log channel that rotates laravel.log by date through RotatingFileHandler. This package is only a reasonable fit when you specifically need size-based rotation, custom retention, compression, or rotation of non-standard application log files.
How can I rotate Laravel logs by size using this package?
Instantiate the rotation class from a scheduled console command or queued job rather than from the request path. Do not start by rotating laravel.log; first test against a non-critical custom log file and compare the filename pattern, retention, compression, and failure behavior with Laravel's native daily channel.
Does cesargb/php-log-rotation support compression and retention limits?
The package description says it compresses archived logs and enforces retention limits to remove old files automatically. Verify the exact API and settings against the installed version, and test compression failures, permissions, and retention naming with realistic log volumes before relying on it.
Does it provide a Monolog handler for Laravel logging channels?
There is no native Monolog handler implied by the package overview. Integrating it with Laravel logging channels therefore requires either a custom Monolog handler wrapper or a post-write scheduled rotation pattern that runs separately from the active writer.
Which PHP and Laravel versions are supported by this package?
The provided context does not specify supported PHP or Laravel versions. There is also no evidence of a Laravel-version compatibility matrix or integration tests against Monolog behavior, so check composer.json constraints and run your own compatibility tests before adoption.
Is it safe to rotate a log file while the application is still writing to it?
Rotating an actively written file can race with the writer, so concurrency must be designed explicitly. Validate file locking, atomic rename behavior, open file handles, and Windows versus Unix differences in a proof of concept before using this on high-traffic logs.
What happens on permission errors, disk-full conditions, or failed compression?
The provided context does not document failure behavior for permission errors, disk-full conditions, or compression failures. Test these cases directly, because silent failure could lead to disk exhaustion or log loss. Confirm whether the package throws exceptions, partially rotates files, or fails silently.
What alternatives should I compare before adopting this package?
Compare Laravel's daily log channel, Monolog's RotatingFileHandler, and system-level logrotate before adding this dependency. The package has low adoption signals, an unknown repository, and unverified release metadata, so adopt it only if a proof of concept demonstrates a clear gap over native Laravel or operating-system rotation.
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.
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
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource