You are here

public function LogRotator::run in File Log 8

Same name and namespace in other branches
  1. 2.0.x src/LogRotator.php \Drupal\filelog\LogRotator::run()

Check and rotate if necessary.

Parameters

bool $force: Bypass the scheduler and force rotation.

Return value

bool Returns TRUE if the rotation was successful.

Throws

\Drupal\filelog\FileLogException

File

src/LogRotator.php, line 109

Class

LogRotator
Log rotation cron service.

Namespace

Drupal\filelog

Code

public function run($force = FALSE) : bool {
  if ($force || $this
    ->shouldRun($this->time
    ->getRequestTime())) {
    return $this
      ->rotateFile();
  }
  return FALSE;
}