Skip to content

Commit

Permalink
Merge pull request #990 from eyra/sentry-hotfix
Browse files Browse the repository at this point in the history
Sentry hotfix
  • Loading branch information
mellelieuwes authored Oct 30, 2024
2 parents 0ba39c8 + a99b57f commit 3b6a530
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions core/frameworks/fabric/live_view.ex
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ defmodule Fabric.LiveView do
defmacro __using__(layout) do
quote do
use Phoenix.LiveView, layout: {unquote(layout), :live}
on_mount(Sentry.LiveViewHook)
unquote(helpers())
end
end

defmacro __using__() do
quote do
use Phoenix.LiveView
on_mount(Sentry.LiveViewHook)
unquote(helpers())
end
end
Expand Down
4 changes: 3 additions & 1 deletion core/lib/core/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ defmodule Core.Application do
use Application

def start(_type, _args) do
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{})
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{
config: %{capture_log_messages: true, level: :error}
})

topologies = [
example: [
Expand Down
2 changes: 2 additions & 0 deletions core/lib/core_web/endpoint.ex
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
defmodule CoreWeb.Endpoint do
use Sentry.PlugCapture
use Phoenix.Endpoint, otp_app: :core

require Systems.Content.Plug
Expand Down Expand Up @@ -69,6 +70,7 @@ defmodule CoreWeb.Endpoint do
json_decoder: Phoenix.json_library()
)

plug(Sentry.PlugContext)
plug(Plug.MethodOverride)
plug(Plug.Head)
plug(Plug.Session, @session_options)
Expand Down

0 comments on commit 3b6a530

Please sign in to comment.