Scheduler.php
private function removeLogs(Schedule $scheduler)
  {
    $scheduler->call(function () {
      $searchDir = Config::$root . 'storage' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR;

      $prefix = config('app.logger.name');
      $logs = glob($searchDir . $prefix . '-*-*-*.log');

      if (count($logs) < 1) return;

      foreach($logs as $log) {
        $date = str_replace($prefix . '-', '', Filesystem::name($log));
        $end = new Carbon($date);
        $now = Carbon::now();

        if ($now->diffInDays($end) > config('app.logger.keep')) {
          try {
            Filesystem::delete($log);
          } catch (\Exception $e) {
            // do nothing...
          }
        }
      }
    })->daily();
  }
private function removeLogs(Schedule $scheduler)
  {
    $scheduler->call(function () {
      $searchDir = Config::$root . 'storage' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR;

      $prefix = config('app.logger.name');
      $logs = glob($searchDir . $prefix . '-*-*-*.log');

      if (count($logs) < 1) return;

      foreach($logs as $log) {
        $date = str_replace($prefix . '-', '', Filesystem::name($log));
        $end = new Carbon($date);
        $now = Carbon::now();

        if ($now->diffInDays($end) > config('app.logger.keep')) {
          try {
            Filesystem::delete($log);
          } catch (\Exception $e) {
            // do nothing...
          }
        }
      }
    })->daily();
  }
private function removeLogs ( Schedule $ scheduler ) { $ scheduler -> call ( function ( ) { $ searchDir = Config :: $ root . 'storage' . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR ; $ prefix = config ( 'app.logger.name' ) ; $ logs = glob ( $ searchDir . $ prefix . '-*-*-*.log' ) ; if ( count ( $ logs ) < 1 ) return ; foreach ( $ logs as $ log ) { $ date = str_replace ( $ prefix . '-' , '' , Filesystem :: name ( $ log ) ) ; $ end = new Carbon ( $ date ) ; $ now = Carbon :: now ( ) ; if ( $ now -> diffInDays ( $ end ) > config ( 'app.logger.keep' ) ) { try { Filesystem :: delete ( $ log ) ; } catch ( \ Exception $ e ) { // do nothing... } } } } ) -> daily ( ) ; }
Remove application logs

@param Schedule $scheduler
@return void
Remove application logs