You are here

RefererProcessor.php in Monolog 8

Same filename and directory in other branches
  1. 2.x src/Logger/Processor/RefererProcessor.php

File

src/Logger/Processor/RefererProcessor.php
View source
<?php

namespace Drupal\monolog\Logger\Processor;


/**
 * Class RefererProcessor
 */
class RefererProcessor extends AbstractRequestProcessor {

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

}

Classes

Namesort descending Description
RefererProcessor Class RefererProcessor