dainsys/clear-laravel-logs

Clear Laravel log files

2.3.0 2020-11-05 03:49 UTC

This package is auto-updated.

Last update: 2024-11-14 03:45:37 UTC


README

Allows to list or delete all laravel...log logs files

Installation

  • Step 1: Add the following entry to your composer.json file:
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/Yismen/clear-laravel-logs.git"
        }
    ]
  • Step 2: Run composer require dainsys/clear-laravel-logs command to install as a dependency
  • Step 3: The Package should be auto-discovered by Laravel. However, you could all register it in your config.app file within the providers array:
        'providers' => [
            Dainsys\ClearLogs\ClearLogsServiceProvider::class,
        ]

Ussage

  • To just list the log files, run without any argument:
    • php artisan dainsys:laravel-logs
  • To remove all existing log files, pass the --clear flag
    • php artisan dainsys:laravel-logs --clear
  • By default, the last 8 files are keept. To override the number of files to preserve, update the --keep flag
    • php artisan dainsys:laravel-logs --clear --keep=0
  • By default, the package search for any file starting with 'laravel-'. To override, pass the desired starting file name as an option
    • php artisan dainsys:laravel-logs new_file_name --clear