You are here

public function IpProcessor::__invoke in Monolog 8

Same name and namespace in other branches
  1. 2.x src/Logger/Processor/IpProcessor.php \Drupal\monolog\Logger\Processor\IpProcessor::__invoke()

Parameters

array $record:

Return value

array

File

src/Logger/Processor/IpProcessor.php, line 15

Class

IpProcessor
Class IpProcessor

Namespace

Drupal\monolog\Logger\Processor

Code

public function __invoke(array $record) {
  if ($request = $this
    ->getRequest()) {
    $record['extra']['ip'] = $request
      ->getClientIp();
  }
  return $record;
}