src/Leevel/Log/File.php
protected function checkSize(string $filePath): void
    {
        $dirname = dirname($filePath);

        if (!is_file($filePath)) {
            create_directory($dirname);
        }

        // 清理文件状态缓存 http://php.net/manual/zh/function.clearstatcache.php
        clearstatcache();

        if (is_file($filePath) &&
            floor($this->option['size']) <= filesize($filePath)) {
            rename($filePath,
                $dirname.'/'.basename($filePath, '.log').'_'.
                (time() - filemtime($filePath)).'.log');
        }
    }
protected function checkSize(string $filePath): void
    {
        $dirname = dirname($filePath);

        if (!is_file($filePath)) {
            create_directory($dirname);
        }

        // 清理文件状态缓存 http://php.net/manual/zh/function.clearstatcache.php
        clearstatcache();

        if (is_file($filePath) &&
            floor($this->option['size']) <= filesize($filePath)) {
            rename($filePath,
                $dirname.'/'.basename($filePath, '.log').'_'.
                (time() - filemtime($filePath)).'.log');
        }
    }
验证日志文件大小.

@param string $filePath