A module for integrating Sentry ( into Zend Framework 2 projects.

dev-master 2017-04-20 10:33 UTC


  1. Require the Sentry Composer package composer require boohoodev/zendsentry
  2. In /config/application.config.php, add Zendsentry into the modules array and ./vendor/boohoodev/zendsentry into the module_paths array, it should look something like this
return [
    // This should be an array of module namespaces used in the application.
    'modules'                 => [

    // These are various options for the listeners attached to the ModuleManager
    'module_listener_options' => [

        // This should be an array of paths in which modules reside.
        'module_paths'      => [

        // An array of paths from which to glob configuration files after
        // modules are loaded.
        'config_glob_paths' => [


Basic setup

Get your project DSN from under Project Settings > Client Keys (DSN) > DSN.

Note: The project DSN is sensitive and should be treated as an API key or password and should not be version controlled.

The default configuration value for ENABLED is false to prevent spamming sentry until explicitly enabled, so this must be manually enabled to start sending events to sentry. To update these config values add the following block to your /config/autoload/local.php.

'SENTRY' => [
    'DSN'     => 'https://***.******',
    'ENABLED' => true,

Additional setup

The default environment to tag events with is dev, to override this when deploying to a uat or production environment we can just specify an environment name in the application local config.

'SENTRY' => [
    'DSN'     => 'https://***.******',
    'ENABLED' => true,
    'ENVIRONMENT' => 'production',