From 7dd0209af7730a229522046dc5bd3f323c7e6131 Mon Sep 17 00:00:00 2001 From: Michael Telgkamp Date: Mon, 28 Oct 2024 11:40:11 +0100 Subject: [PATCH] BUGFIX: Always add space between IP and severity in file logs For all IP addresses of length 15 or longer (most ipv6 addresses) no space was added between the IP address and the Severity. This bugfix always adds a space character between IP and severity. --- Neos.Flow.Log/Classes/Backend/FileBackend.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.Flow.Log/Classes/Backend/FileBackend.php b/Neos.Flow.Log/Classes/Backend/FileBackend.php index ed8cc4e585..f959a6fb94 100644 --- a/Neos.Flow.Log/Classes/Backend/FileBackend.php +++ b/Neos.Flow.Log/Classes/Backend/FileBackend.php @@ -239,7 +239,7 @@ public function append(string $message, int $severity = LOG_INFO, $additionalDat } else { $processId = ' ' . str_pad((string)getmypid(), 10); } - $ipAddress = ($this->logIpAddress === true) ? str_pad(($_SERVER['REMOTE_ADDR'] ?? ''), 15) : ''; + $ipAddress = ($this->logIpAddress === true) ? str_pad(($_SERVER['REMOTE_ADDR'] ?? ''), 15) . ' ' : ''; $severityLabel = $this->severityLabels[$severity] ?? 'UNKNOWN '; $output = (new \DateTime())->format('y-m-d H:i:s') . $processId . ' ' . $ipAddress . $severityLabel . ' ' . str_pad((string)$packageKey, 20) . ' ' . $message;