Skip to content

Commit 3376c4d

Browse files
committed
add section to readme
1 parent 3e9ae28 commit 3376c4d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,40 @@ config :sentry,
7878
| `server_name` | False | None | |
7979
| `use_error_logger` | False | False | |
8080

81+
## Testing Your Configuration
82+
83+
To ensure you've set up your configuration correctly we recommend running the
84+
included mix task. It can be tested on different Mix environments and will tell you if it is not currently configured to send events in that environment:
85+
86+
```bash
87+
$ MIX_ENV=dev mix sentry.send_test_event
88+
Client configuration:
89+
server: https://sentry.io/
90+
public_key: public
91+
secret_key: secret
92+
included_environments: [:prod]
93+
current environment_name: :dev
94+
95+
:dev is not in [:prod] so no test event will be sent
96+
97+
$ MIX_ENV=prod mix sentry.send_test_event
98+
Client configuration:
99+
server: https://sentry.io/
100+
public_key: public
101+
secret_key: secret
102+
included_environments: [:prod]
103+
current environment_name: :prod
104+
105+
Sending test event!
106+
```
107+
108+
A couple of things to note:
109+
110+
* This won't test your environment configuration. The test CLI forces your
111+
configuration to represent itself as if it were running in the production env.
112+
* If you're running within Rails (or anywhere else that will bootstrap the
113+
rake environment), you should be able to omit the DSN argument.
114+
81115

82116
## Docs
83117

0 commit comments

Comments
 (0)