mintware-de/rotation-logger

A PSR-3 implementation with rotation support.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/mintware-de/rotation-logger

v1.0.0 2022-12-14 21:32 UTC

This package is auto-updated.

Last update: 2025-09-19 06:44:00 UTC


README

A PSR-3 Logger implementation that supports rollover.

Installation

composer require mintware-de/rotation-logger

Usage

<?php

use MintwareDe\RotationLogger\Rotation\RotateOptions;
use MintwareDe\RotationLogger\RotationLogger;

require_once __DIR__ . '/vendor/autoload.php';

$logger = RotationLogger::create(
    '/var/log/my-log-file',
    new RotateOptions(
        size: 10 * 1_024 * 1_024, // 10 MB; size in bytes
        rotate: 1, // Create 1 rollover file
    ),
);

$logger->debug('foo');

You can also use the default constructor of the RotationLogger class if you need to overwrite other classes. Take a look in the RotationLogger::create() method if you need guidance.