You are here

class RefererProcessor in Monolog 2.x

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

Class RefererProcessor.

Hierarchy

Expanded class hierarchy of RefererProcessor

1 string reference to 'RefererProcessor'
monolog.services.yml in ./monolog.services.yml
monolog.services.yml
1 service uses RefererProcessor
monolog.processor.referer in ./monolog.services.yml
Drupal\monolog\Logger\Processor\RefererProcessor

File

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

Namespace

Drupal\monolog\Logger\Processor
View source
class RefererProcessor extends AbstractRequestProcessor {

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

}

Members