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
Configuring the backend on config/config.exs may be too early
and cause issues if trying to loading logger config before Sentry
is compiled.
Or it can be an issue in umbrella projects when only some of them
depend on Sentry.
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -93,13 +93,13 @@ defmodule MyAppWeb.ErrorView do
93
93
94
94
### Capture Crashed Process Exceptions
95
95
96
-
This library comes with an extension to capture all error messages that the Plug handler might not. This is based on [Logger.Backend](https://hexdocs.pm/logger/Logger.html#module-backends).
96
+
This library comes with an extension to capture all error messages that the Plug handler might not. This is based on [Logger.Backend](https://hexdocs.pm/logger/Logger.html#module-backends). You can add it as a backend when your application starts:
97
97
98
98
```diff
99
-
#config/config.exs
99
+
#lib/my_app/application.ex
100
100
101
-
+config :logger,
102
-
+backends: [:console, Sentry.LoggerBackend]
101
+
+ def start(_type, _args) do
102
+
+ Logger.add_backend(Sentry.LoggerBackend)
103
103
```
104
104
105
105
The backend can also be configured to capture Logger metadata, which is detailed [here](https://hexdocs.pm/sentry/Sentry.LoggerBackend.html).
0 commit comments