Skip to content

Commit

Permalink
Fix empty IP case
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkyKZ committed Oct 13, 2019
1 parent 0bfdb0c commit c9bf04a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libraries/src/Log/Logger/FormattedtextLogger.php
Expand Up @@ -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.
Expand Down

0 comments on commit c9bf04a

Please sign in to comment.