diff --git a/libraries/src/Log/Logger/FormattedtextLogger.php b/libraries/src/Log/Logger/FormattedtextLogger.php index 5e5395c98e370..159f8182bbfd7 100644 --- a/libraries/src/Log/Logger/FormattedtextLogger.php +++ b/libraries/src/Log/Logger/FormattedtextLogger.php @@ -192,7 +192,12 @@ protected function formatLine(LogEntry $entry) // Set some default field values if not already set. if (!isset($entry->clientIP)) { - $entry->clientIP = IpHelper::getIp(); + $ip = IpHelper::getIp(); + + if ($ip !== '') + { + $entry->clientIP = $ip; + } } // If the time field is missing or the date field isn't only the date we need to rework it.