Skip to content

Commit ac871ae

Browse files
committed
Report all errors to Sentry
1 parent 2f5a341 commit ac871ae

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

config/config.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ config :stripity_stripe,
7979

8080
config :sentry,
8181
dsn: System.get_env("SENTRY_DSN"),
82-
included_environments: ~w(prod staging)a,
83-
use_error_logger: true
82+
enable_source_code_context: true,
83+
included_environments: ~w(prod staging)a
8484

8585
config :code_corps, :sentry, CodeCorps.Sentry.Async
8686

lib/code_corps.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ defmodule CodeCorps do
2626
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
2727
# for other strategies and supported options
2828
opts = [strategy: :one_for_one, name: CodeCorps.Supervisor]
29+
30+
if !(Sentry.Logger in :gen_event.which_handlers(:error_logger)) do
31+
:ok = :error_logger.add_report_handler(Sentry.Logger)
32+
end
33+
2934
Supervisor.start_link(children, opts)
3035
end
3136

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ defmodule CodeCorps.Mixfile do
2828
def application do
2929
[
3030
mod: {CodeCorps, []},
31-
extra_applications: [:scout_apm, :timex, :tzdata]
31+
extra_applications: [:sentry, :logger, :scout_apm, :timex, :tzdata]
3232
]
3333
end
3434

0 commit comments

Comments
 (0)