From 2536d66c3ed0a61d89278879497b8922439682f6 Mon Sep 17 00:00:00 2001 From: blaerf Date: Wed, 17 Dec 2025 15:39:27 +0100 Subject: [PATCH] Log-Viewer aktualisiert --- app/Services/Logging/LogViewerService.php | 14 ++++++++++++++ public/views/logs.php | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/Services/Logging/LogViewerService.php b/app/Services/Logging/LogViewerService.php index 31fb1d5..28486d7 100644 --- a/app/Services/Logging/LogViewerService.php +++ b/app/Services/Logging/LogViewerService.php @@ -308,6 +308,20 @@ class LogViewerService $message = $rest; } + if ($level === null) { + $upper = strtoupper($raw); + + if (str_starts_with($upper, 'PHP WARNING') || str_starts_with($upper, 'WARNING')) { + $level = 'WARNING'; + } elseif (str_starts_with($upper, 'PHP NOTICE') || str_starts_with($upper, 'NOTICE')) { + $level = 'INFO'; + } elseif (str_starts_with($upper, 'PHP FATAL') || str_contains($upper, 'FATAL ERROR') || str_starts_with($upper, 'UNCAUGHT')) { + $level = 'ERROR'; + } else { + $level = 'UNKNOWN'; + } + } + return [ 'ts' => $ts, 'level' => $level, diff --git a/public/views/logs.php b/public/views/logs.php index e53e936..9c235d0 100644 --- a/public/views/logs.php +++ b/public/views/logs.php @@ -144,7 +144,9 @@ declare(strict_types=1); -
+
+                                        
+                                    
-