You are here

public function RefererProcessor::__invoke in Monolog 2.x

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

File

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

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;
}