Drupal
Module for Drupal 10.2+ and 11
What it is for
The official DockRay module connects Drupal to the monitoring platform and automatically reports errors and exceptions that occur while your application is running. Events are sent directly to the DockRay dashboard along with the information needed to investigate them.
Error and Performance Information
Reported events can include:
- the error type, message, and severity level,
- where the error occurred and the stack trace,
- environment and application version information,
- context related to the request being processed.
The module can also monitor HTTP request processing times and optionally collect JavaScript errors occurring in the browser.
Simple Configuration
You can configure the integration under Configuration → Development → DockRay by entering your project token and private key. The credentials can also be stored in the settings.php file.
Developer Features
DockRay automatically integrates with Drupal’s logging system. You can also manually report caught exceptions and send messages using Drupal’s standard logger.
Events are sent in the background after the response has been prepared, so temporary monitoring service outages do not delay the website response for the user.
Installation
-
In your Drupal project directory, install the module using Composer:
bash
composer require drupal/dockray -
Enable the module using Drush:
drush en dock_ray
Configuration
- Go to Configuration → Development → DockRay.
- Enter the project token and private key available in the DockRay dashboard.
- Save the configuration.
- Click Send a test event to verify the connection to DockRay.
The private key can also be stored in the settings.php file, so it does not need to be included in the configuration exported to your repository.
How to use it
The integration reports exceptions on its own. This is for the reports you send deliberately.
<?php
try {
$this->import();
} catch (\Throwable $exception) {
\Drupal::service('dock_ray.hub')->captureException($exception);
throw $exception;
}
Knowledge base articles
Other integrations
All integrationsWordPress and WooCommerce Plugin
Explore integrationModule for PrestaShop 1.7.8+, 8.x, and 9.x
Explore integrationPlugin for Joomla 4, 5, and 6
Explore integrationModule for Magento 2.4 and Adobe Commerce
Explore integrationPackage for Laravel 10+
Explore integrationBundle for Symfony 6.4+
Explore integrationLibrary for PHP Applications
Explore integrationClient for Django, FastAPI, Flask, and Scripts
Explore integrationStart Monitoring
Connect your first application and get full visibility into what’s happening in production.