From deb0b328e3d16edd19d51c71ac2607382dd46a22 Mon Sep 17 00:00:00 2001 From: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com> Date: Sat, 16 Nov 2024 18:34:35 +0100 Subject: [PATCH] better log content (#365) --- app/Models/ServerLog.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Models/ServerLog.php b/app/Models/ServerLog.php index b9b339f..e308ee4 100755 --- a/app/Models/ServerLog.php +++ b/app/Models/ServerLog.php @@ -132,10 +132,12 @@ public function getContent($lines = null): ?string return tail(Storage::disk($this->disk)->path($this->name), $lines); } - return Storage::disk($this->disk)->get($this->name); + $content = Storage::disk($this->disk)->get($this->name); + + return $content ?? 'Empty log file!'; } - return ''; + return "Log file doesn't exist!"; } public static function log(Server $server, string $type, string $content, ?Site $site = null): static