Hey there,
I’ve attempted to integrate sentry to Pimcore. The forum didn’t give me any results, so am asking here now.
- Add Sentry:
composer require sentry/sentry-symfony:^3.0
- Register bundle in AppKernel
public function registerBundles()
{
$bundles = [
// ...
new \Sentry\SentryBundle\SentryBundle(),
];
// ...
}
- Add sentry to services.yml
services:
...
sentry:
dsn: '%env(SENTRY_DSN)%'
options:
excluded_exceptions:
- Symfony\Component\Security\Core\Exception\AccessDeniedException
- Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
parameters:
env(SENTRY_DSN): ''
My AppKernel looks different though, it doesn’t have registerBundles
but the following:
class AppKernel extends Kernel
{
/**
* Adds bundles to register to the bundle collection. The collection is able
* to handle priorities and environment specific bundles.
*
* @param BundleCollection $collection
*/
public function registerBundlesToCollection(BundleCollection $collection)
{
if (class_exists('\\AppBundle\\AppBundle')) {
$collection->addBundle(new \AppBundle\AppBundle);
}
if (class_exists('\Pimcore\Bundle\LegacyBundle\PimcoreLegacyBundle')) {
$collection->addBundle(new \Pimcore\Bundle\LegacyBundle\PimcoreLegacyBundle);
}
// tried adding it like that then
if (class_exists('\Sentry\SentryBundle\SentryBundle')) {
$collection->addBundle(new \Sentry\SentryBundle\SentryBundle());
}
}
}
Could anyone help me out on this?
Also getting this error:
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: The configuration key "dsn" is unsupported for definition "sentry" in "/Users/.../Documents/code/...-pimcore/src/app/config/services.yml". Allowed configuration keys are "alias", "parent", "class", "shared", "synthetic", "lazy", "public", "abstract", "deprecated", "factory", "file", "arguments", "properties", "configurator", "calls", "tags", "decorates", "decoration_inner_name", "decoration_priority", "decoration_on_invalid", "autowire", "autoconfigure", "bind". in /Users/.../Documents/code/...-pimcore/src/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php:876