pawelt/logcleaner

There is no license information available for the latest version (1.0.0) of this package.

Module that helps with logs cleaning.

1.0.0 2023-12-16 16:01 UTC

This package is not auto-updated.

Last update: 2024-10-06 18:22:06 UTC


README

Simple solution, made for easy old logs cleanup.

Installation

Instalation is simple. Just get install composer dependency:

$ composer require pawelt/logcleaner

And inside project:

<?php

use LogCleaner\LogCleanerContext;
use LogCleaner\Strategy\DTO\FileCleanerStrategyDTO;
use LogCleaner\Strategy\FileCleanerStrategy;

...

 // For example
 $logCleaner = new LogCleanerContext(new FileCleanerStrategy());

 $dto = new FileCleanerStrategyDTO();
 $dto->setPath('path/to/log');
 $dto->setTimePeriod(3);

 $logCleaner->clean($dto);