From ad74234ab4a6878c841bb96740be8a39865d43e1 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Thu, 4 Feb 2021 18:57:26 +0100 Subject: [PATCH] Upgrade to use latest Sentry Signed-off-by: Thomas Citharel --- config/config.exs | 4 ++++ lib/web/endpoint.ex | 4 +++- lib/web/router.ex | 2 -- mix.exs | 2 +- mix.lock | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/config/config.exs b/config/config.exs index 7c09a22c1..0e753668a 100644 --- a/config/config.exs +++ b/config/config.exs @@ -115,6 +115,10 @@ config :logger, :console, format: "$time $metadata[$level] $message\n", metadata: [:request_id] +config :logger, Sentry.LoggerBackend, + level: :warn, + capture_log_messages: true + config :mobilizon, Mobilizon.Web.Auth.Guardian, issuer: "mobilizon" config :guardian, Guardian.DB, diff --git a/lib/web/endpoint.ex b/lib/web/endpoint.ex index 8424e3e0e..1cc9bdd82 100644 --- a/lib/web/endpoint.ex +++ b/lib/web/endpoint.ex @@ -2,9 +2,9 @@ defmodule Mobilizon.Web.Endpoint do @moduledoc """ Endpoint for Mobilizon app """ + use Sentry.PlugCapture use Phoenix.Endpoint, otp_app: :mobilizon use Absinthe.Phoenix.Endpoint - use Sentry.Phoenix.Endpoint plug(Mobilizon.Web.Plugs.SetLocalePlug) plug(Mobilizon.Web.Plugs.HTTPSecurityPlug) @@ -82,4 +82,6 @@ defmodule Mobilizon.Web.Endpoint do def websocket_url do String.replace_leading(url(), "http", "ws") end + + plug(Sentry.PlugContext) end diff --git a/lib/web/router.ex b/lib/web/router.ex index b37d75c4e..a74a84bfd 100644 --- a/lib/web/router.ex +++ b/lib/web/router.ex @@ -3,8 +3,6 @@ defmodule Mobilizon.Web.Router do Router for mobilizon app """ use Mobilizon.Web, :router - use Plug.ErrorHandler - use Sentry.Plug pipeline :graphql do # plug(:accepts, ["json"]) diff --git a/mix.exs b/mix.exs index c3065ee08..545d96b60 100644 --- a/mix.exs +++ b/mix.exs @@ -141,7 +141,7 @@ defmodule Mobilizon.Mixfile do {:remote_ip, "~> 0.2.0"}, {:ex_cldr_languages, "~> 0.2.1"}, {:slugger, "~> 0.3"}, - {:sentry, "~> 7.0"}, + {:sentry, "~> 8.0"}, # Dev and test dependencies {:phoenix_live_reload, "~> 1.2", only: [:dev, :e2e]}, {:ex_machina, "~> 2.3", only: [:dev, :test]}, diff --git a/mix.lock b/mix.lock index 2bbde184a..bcfec9f8a 100644 --- a/mix.lock +++ b/mix.lock @@ -112,7 +112,7 @@ "ranch": {:hex, :ranch, "1.7.1", "6b1fab51b49196860b733a49c07604465a47bdb78aa10c1c16a3d199f7f8c881", [:rebar3], [], "hexpm", "451d8527787df716d99dc36162fca05934915db0b6141bbdac2ea8d3c7afc7d7"}, "remote_ip": {:hex, :remote_ip, "0.2.1", "cd27cd8ea54ecaaf3532776ff4c5e353b3804e710302e88c01eadeaaf42e7e24", [:mix], [{:combine, "~> 0.10", [hex: :combine, repo: "hexpm", optional: false]}, {:inet_cidr, "~> 1.0", [hex: :inet_cidr, repo: "hexpm", optional: false]}, {:plug, "~> 1.5", [hex: :plug, repo: "hexpm", optional: false]}], "hexpm", "2e7ab1a461cc3cd5719f37e116a08f45c8b8493923063631b164315d6b7ee8e0"}, "rsa_ex": {:hex, :rsa_ex, "0.4.0", "e28dd7dc5236e156df434af0e4aa822384c8866c928e17b785d4edb7c253b558", [:mix], [], "hexpm", "40e1f08e8401da4be59a6dd0f4da30c42d5bb01703161f0208d839d97db27f4e"}, - "sentry": {:hex, :sentry, "7.2.5", "570db92c3bbacd6ad02ac81cba8ac5af11235a55d65ac4375e3ec833975b83d3", [:mix], [{:hackney, "~> 1.8 or 1.6.5", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.3", [hex: :phoenix, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 1.0 or ~> 2.0", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "ea84ed6848505ff2a246567df562f465d2b34c317d3ecba7c7df58daa56e5e5d"}, + "sentry": {:hex, :sentry, "8.0.4", "6886ea584fa0dfc144dd3d8c4723570a4c0c6387a639077de34fce96b11995e2", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:plug_cowboy, "~> 2.3", [hex: :plug_cowboy, repo: "hexpm", optional: true]}], "hexpm", "781e4e0a8d4524c015f0f8d82e6bc30e6bf33df622da58d8c89d30c3cb943e67"}, "shortuuid": {:hex, :shortuuid, "2.1.2", "14dbafdb2f6c7213fdfcc05c7572384b5051a7b1621170018ad4c05504bd96c1", [:mix], [], "hexpm", "d9b0c4f37500ea5199b6275ece872e213e9f45a015caf4aa777cec84f63ad353"}, "sitemapper": {:hex, :sitemapper, "0.5.0", "23b0bb7b3888f03d4e4e5bedb7034e6d2979e169366372d960d6f433112b9bdf", [:mix], [{:ex_aws_s3, "~> 2.0", [hex: :ex_aws_s3, repo: "hexpm", optional: true]}, {:xml_builder, "~> 2.1.1", [hex: :xml_builder, repo: "hexpm", optional: false]}], "hexpm", "be7acff8d0245aa7ca125b9c4d0751009bbbca26ef866d888fef4fdf98670e41"}, "sleeplocks": {:hex, :sleeplocks, "1.1.1", "3d462a0639a6ef36cc75d6038b7393ae537ab394641beb59830a1b8271faeed3", [:rebar3], [], "hexpm", "84ee37aeff4d0d92b290fff986d6a95ac5eedf9b383fadfd1d88e9b84a1c02e1"},