diff --git a/src/Pages/ViewLog.php b/src/Pages/ViewLog.php index ec52ca8..3c9051e 100644 --- a/src/Pages/ViewLog.php +++ b/src/Pages/ViewLog.php @@ -46,7 +46,11 @@ public function read(): string return ''; } - return File::get($this->logFile); + $logContent = File::get($this->logFile); + + $logEntries = preg_split('/(?=\[\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\])/', $logContent, -1, PREG_SPLIT_NO_EMPTY); + + return collect($logEntries)->reverse()->join("\n"); } public function clear(): void