return $result;
} /**
* @param string $filePath
*
* @return int
*/
public function countLogFile($filePath) { $file =
new SplFileObject($filePath, 'r'
);
$file->
seek(PHP_INT_MAX
);
return $file->
key();
} /**
* @return array{data?: string, channel?: string, level?: string, message?: string, context?: string, extra?: string, raw: string}
*/
private function parseLine(string
$log): array
{ $pattern = '/\[(?P<date>[^\[]*)\] (?P<channel>\w+).(?P<level>\w+): (?P<message>[^\[{]+) (?P<context>[\[\{].*[\]\}]) (?P<extra>[\[\{].*[\]\}])/';