Skip to content

Commit 1e203be

Browse files
Merge pull request #272 from craiglyons/master
Add documentation for capturing arbitrary events
2 parents 6482046 + 096b17e commit 1e203be

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ rescue
3434
end
3535
```
3636

37+
### Capture Non-Exception Events
38+
39+
Sometimes you want to capture arbitrary messages that are not Exceptions.
40+
41+
```elixir
42+
Sentry.capture_message("custom_event_name", extra: %{extra: information})
43+
```
44+
3745
For optional settings check the [docs](https://hexdocs.pm/sentry/readme.html).
3846

3947
### Setup with Plug or Phoenix
@@ -66,7 +74,7 @@ def start(_type, _opts) do
6674
supervisor(MyApp.Repo, []),
6775
supervisor(MyAppWeb.Endpoint, [])
6876
]
69-
77+
7078
opts = [strategy: :one_for_one, name: MyApp.Supervisor]
7179

7280
:ok = :error_logger.add_report_handler(Sentry.Logger)
@@ -99,7 +107,7 @@ end
99107
| `context_lines` | False | 3 | |
100108
| `source_code_exclude_patterns` | False | `[~r"/_build/", ~r"/deps/", ~r"/priv/"]` | |
101109
| `source_code_path_pattern` | False | `"**/*.ex"` | |
102-
| `filter` | False | | Module where the filter rules are defined (see [Filtering Exceptions](https://hexdocs.pm/sentry/Sentry.html#module-filtering-exceptions)) |
110+
| `filter` | False | | Module where the filter rules are defined (see [Filtering Exceptions](https://hexdocs.pm/sentry/Sentry.html#module-filtering-exceptions)) |
103111

104112
An example production config might look like this:
105113

0 commit comments

Comments
 (0)