darwinnatha/purge-logs

a simple package for deleting logs by keeping those at a given period

Installs: 159

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/darwinnatha/purge-logs

v1.0 2024-10-07 03:00 UTC

This package is auto-updated.

Last update: 2025-12-07 19:06:08 UTC


README

Latest Version on Packagist Total Downloads

This package allows you to delete logs, keeping only those from a given period.

Installation

To install this package, you should add the package to your project via Composer.

composer require darwinnatha/pure-logs

Usage

To use this package, publish the configuration file.

php artisan vendor:publish --provider="Darwinnatha\PurgeLogs\PurgeLogsServiceProvider"

Then, you can purge the logs by running the following command.

php artisan logs:purge

Alternatively, if you want to specify the number of days to retain, you can use the keep-days argument.

php artisan logs:purge --keep-days=7

Configuration

You can configure the number of days to retain by editing the config/purge-logs.php file.

return [
    'retention_period' => 7,
];