You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-63Lines changed: 40 additions & 63 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,16 +33,19 @@ end
33
33
34
34
In your Plug.Router or Phoenix.Router, add the following lines:
35
35
36
-
```elixir
37
-
usePlug.ErrorHandler
38
-
useSentry.Plug
36
+
```diff
37
+
# lib/my_app_web/router.ex
38
+
defmodule MyAppWeb.Router do
39
+
use MyAppWeb, :router
40
+
+ use Plug.ErrorHandler
41
+
+ use Sentry.Plug
39
42
```
40
43
41
44
If you are using Phoenix, you can also include [Sentry.Phoenix.Endpoint](https://hexdocs.pm/sentry/Sentry.Phoenix.Endpoint.html) in your Endpoint. This module captures errors occurring in the Phoenix pipeline before the request reaches the Router:
42
45
43
-
```elixir
44
-
usePhoenix.Endpoint, otp_app::my_app
45
-
useSentry.Phoenix.Endpoint
46
+
```diff
47
+
use Phoenix.Endpoint, otp_app: :my_app
48
+
+use Sentry.Phoenix.Endpoint
46
49
```
47
50
48
51
More information on why this may be necessary can be found here: https://github.com/getsentry/sentry-elixir/issues/229 and https://github.com/phoenixframework/phoenix/issues/2791
@@ -53,19 +56,21 @@ This library comes with an extension to capture all error messages that the Plug
53
56
54
57
To set this up, add `{:ok, _} = Logger.add_backend(Sentry.LoggerBackend)` to your application's start function. Example:
In this example, we are getting the environment name from the `RELEASE_LEVEL`
167
-
environment variable. If that variable does not exist, we default to `"development"`.
168
-
Now, on our servers, we can set the environment variable appropriately. On
169
-
our local development machines, exceptions will never be sent, because the
170
-
default value is not in the list of `included_environments`.
171
-
172
149
Sentry uses the [hackney HTTP client](https://github.com/benoitc/hackney) for HTTP requests. Sentry starts its own hackney pool named `:sentry_pool` with a default connection pool of 50, and a connection timeout of 5000 milliseconds. The pool can be configured with the `hackney_pool_max_connections` and `hackney_pool_timeout` configuration keys. If you need to set other [hackney configurations](https://github.com/benoitc/hackney/blob/master/doc/hackney.md#request5) for things like a proxy, using your own pool or response timeouts, the `hackney_opts` configuration is passed directly to hackney for each request.
0 commit comments