@@ -21,51 +21,6 @@ defp deps do
2121end
2222```
2323
24- An example production config might look like this:
25-
26- ``` elixir
27- config :sentry ,
28- dsn: " https://public:[email protected] /1" ,
29- environment_name: :prod ,
30- included_environments: [:prod ],
31- tags: %{
32- env: " production"
33- }
34- ```
35-
36- The environment
37-
38- The ` environment_name ` and ` included_environments ` work together to determine
39- if and when Sentry should record exceptions. The ` environment_name ` is the
40- name of the current environment. In the example above, we have explicitly set
41- the environment to ` :prod ` which works well if you are inside an environment
42- specific configuration like ` config/prod.exs ` .
43-
44- Alternatively, you could use Mix.env in your general configuration file:
45-
46- ``` elixir
47- config
:sentry ,
dsn: " https://public:[email protected] /1" 48- included_environments: [:prod ],
49- environment_name: Mix .env
50- ```
51-
52- You can even rely on more custom determinations of the environment name. It's
53- not uncommmon for most applications to have a "staging" environment. In order
54- to handle this without adding an additional Mix environment, you can set an
55- environment variable that determines the release level.
56-
57- ``` elixir
58- config
:sentry ,
dsn: " https://public:[email protected] /1" 59- included_environments: ~w( production staging) ,
60- environment_name: System .get_env (" RELEASE_LEVEL" ) || " development"
61- ```
62-
63- In this example, we are getting the environment name from the ` RELEASE_LEVEL `
64- environment variable. If that variable does not exist, we default to ` "development" ` .
65- Now, on our servers, we can set the environment variable appropriately. On
66- our local development machines, exceptions will never be sent, because the
67- default value is not in the list of ` included_environments ` .
68-
6924### Capture Exceptions
7025
7126Sometimes you want to capture specific exceptions, to do so use the ` Sentry.capture_exception/3 ` .
@@ -113,6 +68,49 @@ config :sentry,
11368| ` server_name ` | False | None | |
11469| ` use_error_logger ` | False | False | |
11570
71+ An example production config might look like this:
72+
73+ ``` elixir
74+ config :sentry ,
75+ dsn: " https://public:[email protected] /1" ,
76+ environment_name: :prod ,
77+ included_environments: [:prod ],
78+ tags: %{
79+ env: " production"
80+ }
81+ ```
82+
83+ The ` environment_name ` and ` included_environments ` work together to determine
84+ if and when Sentry should record exceptions. The ` environment_name ` is the
85+ name of the current environment. In the example above, we have explicitly set
86+ the environment to ` :prod ` which works well if you are inside an environment
87+ specific configuration like ` config/prod.exs ` .
88+
89+ Alternatively, you could use Mix.env in your general configuration file:
90+
91+ ``` elixir
92+ config
:sentry ,
dsn: " https://public:[email protected] /1" 93+ included_environments: [:prod ],
94+ environment_name: Mix .env
95+ ```
96+
97+ You can even rely on more custom determinations of the environment name. It's
98+ not uncommmon for most applications to have a "staging" environment. In order
99+ to handle this without adding an additional Mix environment, you can set an
100+ environment variable that determines the release level.
101+
102+ ``` elixir
103+ config
:sentry ,
dsn: " https://public:[email protected] /1" 104+ included_environments: ~w( production staging) ,
105+ environment_name: System .get_env (" RELEASE_LEVEL" ) || " development"
106+ ```
107+
108+ In this example, we are getting the environment name from the ` RELEASE_LEVEL `
109+ environment variable. If that variable does not exist, we default to ` "development" ` .
110+ Now, on our servers, we can set the environment variable appropriately. On
111+ our local development machines, exceptions will never be sent, because the
112+ default value is not in the list of ` included_environments ` .
113+
116114## Testing Your Configuration
117115
118116To ensure you've set up your configuration correctly we recommend running the
0 commit comments