Sentry is not working in different server

2019-07-17 03:45发布

问题:

I used sentry in my symfony 4.2 application to capture exceptions. That is working fine in the development environment which is running on the local server. But in the staging which running on another server, it doesn't log exceptions in the sentry site. So where could I get wrong? In the sentry.yaml, is there a place to add the server name?

Sentry\SentryBundle\SentryBundle::class => ['all' => true]

In bundles.php it has configured as above.

composer.json as follows.

"require": {
    "sentry/sdk": "2.0.2",
    "sentry/sentry-symfony": "^2.3"
}

"replace": {
    "sentry/sdk": "^2.0"
}

I created one sentry.yaml file for both local and staging which is built through jenkins. sentry.yaml is similar as in below.

sentry:
   dsn: "https://<key>@sentry.io/<project>"

Also I tried adding two different dsn for dev environment and production environment separately by defining two sentry.yaml files in dev folder and prod folder. But that was also not worked.