Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #35 from cultuurnet/fix/III-3386-init-sentry-singl…
Browse files Browse the repository at this point in the history
…eton

III-3386 Fix Sentry SDK hub initialisation
  • Loading branch information
LucWollants committed Oct 6, 2020
2 parents 0643a67 + c0ab4af commit d7f95a1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/SentryServiceProvider.php
Expand Up @@ -4,24 +4,24 @@

namespace CultuurNet\UDB3\UiTPASService;

use Sentry\ClientBuilder;
use Sentry\State\Hub;
use Sentry\SentrySdk;
use Sentry\State\HubInterface;
use Silex\Application;
use Silex\ServiceProviderInterface;
use function Sentry\init;

class SentryServiceProvider implements ServiceProviderInterface
{
public function register(Application $app): void
{
$app[HubInterface::class] = $app->share(
function ($app) {
return new Hub(
ClientBuilder::create([
'dsn' => $app['config']['sentry']['dsn'],
'environment' => $app['config']['sentry']['environment'],
])->getClient()
);
function (Application $app) {
init([
'dsn' => $app['config']['sentry']['dsn'],
'environment' => $app['config']['sentry']['environment'],
]);

return SentrySdk::getCurrentHub();
}
);
}
Expand Down

0 comments on commit d7f95a1

Please sign in to comment.