Run the following to install this library:
$ composer require timrutte/laminas-log-processor-ip-address
$logger = new \Laminas\Log\Logger();
$logger->addProcessor(new \TimRutte\Laminas\Log\Processor\IpAddress());
$writer = new \Laminas\Log\Writer\Stream();
$formatter = new \Laminas\Log\Formatter\Json();
$writer->setFormatter($formatter);
$logger->addWriter($writer);