Giter Club home page Giter Club logo

artisan-log-cleaner's Introduction

Build Status Total Downloads License Latest Stable Version

Artisan Log Cleaner

An artisan command to clear laravel log files

Table of contents

Installation

Install via composer

composer require hedii/artisan-log-cleaner

Add it to your providers array in config/app.php:

Hedii\ArtisanLogCleaner\ArtisanLogCleanerServiceProvider::class

Usage

Clear all log files

Run this command to clear all log files in the log directory (storage/logs):

php artisan log:clear

Clear all log files except the last one

Run this command to clear all log files except the last one in the log directory (storage/logs):

php artisan log:clear --keep-last

Clear all log files except specified file names

Run this command to clear all log files except the specified files in the option. Specify file name without extension. Can be combined with --keep-last option.

php artisan log:clear --keep="keptLog"

Automated cleanup of log files

Add this to the App\Console\Kernel schedule method to ensure daily cleanup of old log files

$schedule->command('log:clear --keep-last')->daily();

Testing

composer test

License

hedii/artisan-log-cleaner is released under the MIT Licence. See the bundled LICENSE file for details.

artisan-log-cleaner's People

Contributors

adhityairvan avatar hedii avatar laravel-shift avatar martinjoiner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

artisan-log-cleaner's Issues

Laravel 10

Any chance you can merge that Laravel 10 PR?

Error in Laravel 5.4

Installing ArtisanLogCleaner breaks artisan on Laravel 5.4

[Symfony\Component\Debug\Exception\FatalThrowableError] Type error: Argument 1 passed to Hedii\ArtisanLogCleaner\ClearLogs::__construct() must be an instance of Illuminate\Filesystem\Filesystem, instance of Illuminate\Found ation\Application given, called in /vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 208

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.