sgoettsch / monolog-rotating-file-handler
Rotating File Handler for Monolog library
Installs: 22 678
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 2
Open Issues: 0
Requires
- php: ^8.1
- monolog/monolog: ^3
Requires (Dev)
- phpmd/phpmd: ^2.5
- phpunit/phpunit: ^10
- squizlabs/php_codesniffer: *
This package is auto-updated.
Last update: 2025-03-14 22:26:22 UTC
README
Handler for PHP logging library Monolog for rotating files automatically based on a specific size.
Features
- Rotate files based on files size
- Remove files more than the X
Installation
Install the latest version with Composer
$ composer require sgoettsch/monolog-rotating-file-handler
Basic Usage
<?php use sgoettsch\MonologRotatingFileHandler\Handler\MonologRotatingFileHandler; use Monolog\Logger; // path to log file $filename = 'app.log'; // Instantiate handler $handler = new MonologRotatingFileHandler($filename); // Create a log channel $log = new Logger('name'); // Set handler $log->pushHandler($handler); // Add records to the log $log->debug('Foo'); $log->warning('Bar'); $log->error('Baz');
Issues
Feel free to report any issues