mirror of
https://github.com/plausible/analytics.git
synced 2025-01-03 15:17:58 +03:00
Drop Logger backends (#4862)
* drop console logger backend * ah, switch Sentry too
This commit is contained in:
parent
7f4c2b6fb7
commit
24888cff3c
@ -26,26 +26,15 @@ log_level =
|
||||
|> get_var_from_path_or_env("LOG_LEVEL", default_log_level)
|
||||
|> String.to_existing_atom()
|
||||
|
||||
config :logger,
|
||||
level: log_level,
|
||||
backends: [:console]
|
||||
|
||||
config :logger, Sentry.LoggerBackend,
|
||||
capture_log_messages: true,
|
||||
level: :error
|
||||
config :logger, level: log_level
|
||||
config :logger, :default_formatter, metadata: [:request_id]
|
||||
|
||||
case String.downcase(log_format) do
|
||||
"standard" ->
|
||||
config :logger, :console,
|
||||
format: "$time $metadata[$level] $message\n",
|
||||
metadata: [:request_id]
|
||||
config :logger, :default_formatter, format: "$time $metadata[$level] $message\n"
|
||||
|
||||
"json" ->
|
||||
config :logger, :console,
|
||||
format: {ExJsonLogger, :format},
|
||||
metadata: [
|
||||
:request_id
|
||||
]
|
||||
config :logger, :default_formatter, format: {ExJsonLogger, :format}
|
||||
end
|
||||
|
||||
# Listen IP supports IPv4 and IPv6 addresses.
|
||||
|
@ -226,7 +226,9 @@ defmodule Plausible.Application do
|
||||
end
|
||||
|
||||
def setup_sentry() do
|
||||
Logger.add_backend(Sentry.LoggerBackend)
|
||||
:logger.add_handler(:sentry_handler, Sentry.LoggerHandler, %{
|
||||
config: %{capture_log_messages: true, level: :error}
|
||||
})
|
||||
|
||||
:telemetry.attach_many(
|
||||
"oban-errors",
|
||||
|
Loading…
Reference in New Issue
Block a user