Setup Sentry

This commit is contained in:
Claudio Ortolina
2024-10-03 10:11:04 +01:00
parent a02e6a5fcf
commit ecce630ae4
6 changed files with 27 additions and 1 deletions
+4
View File
@@ -7,6 +7,10 @@ defmodule MusicLibrary.Application do
@impl true
def start(_type, _args) do
:logger.add_handler(:my_sentry_handler, Sentry.LoggerHandler, %{
config: %{metadata: [:file, :line]}
})
children = [
MusicLibraryWeb.Telemetry,
MusicLibrary.Repo,
+3
View File
@@ -1,4 +1,5 @@
defmodule MusicLibraryWeb.Endpoint do
use Sentry.PlugCapture
use Phoenix.Endpoint, otp_app: :music_library
# The session will be stored in the cookie and signed,
@@ -46,6 +47,8 @@ defmodule MusicLibraryWeb.Endpoint do
pass: ["*/*"],
json_decoder: Phoenix.json_library()
plug Sentry.PlugContext
plug Plug.MethodOverride
plug Plug.Head
plug Plug.Session, @session_options