You are here

public function AbstractRequestProcessor::getRequest in Monolog 8

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

Return value

null|\Symfony\Component\HttpFoundation\Request

3 calls to AbstractRequestProcessor::getRequest()
IpProcessor::__invoke in src/Logger/Processor/IpProcessor.php
RefererProcessor::__invoke in src/Logger/Processor/RefererProcessor.php
RequestUriProcessor::__invoke in src/Logger/Processor/RequestUriProcessor.php

File

src/Logger/Processor/AbstractRequestProcessor.php, line 29

Class

AbstractRequestProcessor
Base class for all processors that needs access to request data.

Namespace

Drupal\monolog\Logger\Processor

Code

public function getRequest() {
  if ($this->requestStack && ($request = $this->requestStack
    ->getCurrentRequest())) {
    return $request;
  }
  return NULL;
}