You are here

public function RefererProcessor::__invoke in Monolog 8

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

Parameters

array $record:

Return value

array

File

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

Class

RefererProcessor
Class RefererProcessor

Namespace

Drupal\monolog\Logger\Processor

Code

public function __invoke(array $record) {
  if ($request = $this
    ->getRequest()) {
    $record['extra']['referer'] = $request->headers
      ->get('Referer', '');
  }
  return $record;
}