Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ExceptionLoggingSubscriber.php

function ExceptionLoggingSubscriber::on404

Log 404 errors.

Parameters

\Symfony\Component\HttpKernel\Event\ExceptionEvent $event: The event to process.

File

core/lib/Drupal/Core/EventSubscriber/ExceptionLoggingSubscriber.php, line 56

Class

ExceptionLoggingSubscriber
Log exceptions without further handling.

Namespace

Drupal\Core\EventSubscriber

Code

public function on404(ExceptionEvent $event) {
    $request = $event->getRequest();
    $this->logger
        ->get('page not found')
        ->warning('@uri', [
        '@uri' => $request->getRequestUri(),
    ]);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal