From 15a38cc5807eef4c39162e9495fcfbdc8341a3c1 Mon Sep 17 00:00:00 2001 From: ruslandoga Date: Thu, 19 Dec 2024 01:57:49 +0700 Subject: [PATCH] revert to sentry logger backend (#4919) --- config/runtime.exs | 4 ++++ lib/plausible/application.ex | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/config/runtime.exs b/config/runtime.exs index d1c681cc0b16..93884f0573e1 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -29,6 +29,10 @@ log_level = config :logger, level: log_level config :logger, :default_formatter, metadata: [:request_id] +config :logger, Sentry.LoggerBackend, + capture_log_messages: true, + level: :error + case String.downcase(log_format) do "standard" -> config :logger, :default_formatter, format: "$time $metadata[$level] $message\n" diff --git a/lib/plausible/application.ex b/lib/plausible/application.ex index 76ca499ad9cc..1e0e6a23c551 100644 --- a/lib/plausible/application.ex +++ b/lib/plausible/application.ex @@ -226,9 +226,7 @@ defmodule Plausible.Application do end def setup_sentry() do - :logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{ - config: %{capture_log_messages: true, level: :error} - }) + Logger.add_backend(Sentry.LoggerBackend) :telemetry.attach_many( "oban-errors",