boohoodev / zendsentry
A module for integrating Sentry (sentry.io) into Zend Framework 2 projects.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- sentry/sentry: ^1.6
This package is not auto-updated.
Last update: 2021-02-06 07:52:06 UTC
README
- Require the Sentry Composer package
composer require boohoodev/zendsentry
- In
/config/application.config.php
, addZendsentry
into themodules
array and./vendor/boohoodev/zendsentry
into themodule_paths
array, it should look something like this
return [
// This should be an array of module namespaces used in the application.
'modules' => [
'Application',
'Zendsentry',
],
// 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' => [
'./module',
'./vendor',
'./vendor/boohoodev/zendsentry',
],
// An array of paths from which to glob configuration files after
// modules are loaded.
'config_glob_paths' => [
'config/autoload/{,*.}{global,local}.php',
],
],
];
Configuration
Basic setup
Get your project DSN from sentry.io 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://***.***@sentry.io/***',
'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://***.***@sentry.io/***',
'ENABLED' => true,
'ENVIRONMENT' => 'production',
]