class RequestSubscriber in Raven: Sentry Integration 8.2
Same name and namespace in other branches
- 3.x src/EventSubscriber/RequestSubscriber.php \Drupal\raven\EventSubscriber\RequestSubscriber
Initializes Raven logger if fatal error logging is enabled.
Hierarchy
- class \Drupal\raven\EventSubscriber\RequestSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface, \Symfony\Component\DependencyInjection\ContainerAwareInterface uses \Symfony\Component\DependencyInjection\ContainerAwareTrait
Expanded class hierarchy of RequestSubscriber
1 string reference to 'RequestSubscriber'
1 service uses RequestSubscriber
File
- src/
EventSubscriber/ RequestSubscriber.php, line 14
Namespace
Drupal\raven\EventSubscriberView source
class RequestSubscriber implements EventSubscriberInterface, ContainerAwareInterface {
use ContainerAwareTrait;
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a new Raven RequestSubscriber.
*
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory.
*/
public function __construct(ConfigFactoryInterface $config_factory) {
$this->configFactory = $config_factory;
}
/**
* Initializes Raven logger if fatal error logging is enabled.
*/
public function onRequest() {
if ($this->configFactory
->get('raven.settings')
->get('fatal_error_handler')) {
$this->container
->get('logger.raven');
}
}
/**
* Registers the methods in this class that should be listeners.
*
* @return array
* An array of event listener definitions.
*/
public static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = [
'onRequest',
222,
];
return $events;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestSubscriber:: |
protected | property | The config factory. | |
RequestSubscriber:: |
public static | function | Registers the methods in this class that should be listeners. | |
RequestSubscriber:: |
public | function | Initializes Raven logger if fatal error logging is enabled. | |
RequestSubscriber:: |
public | function | Constructs a new Raven RequestSubscriber. |