Elixir 1.19: Refactor Logger configuration to what Elixir 1.15+ expects
Elixir 1.19 started emitting warnings about our use of: config :logger, :console and config :logger, backends: [] which got split in 1.15 to :default_handler, :default_formatter, and LoggerBackends.add(backend) respectively. On Pleroma startup it is now necessary to add the additional logger backends at runtime (done with configure_logger() in application.ex). New config key :pleroma, :logger_backends: [] has replaced the older backends array. The logger_backends package is now used to facilitate usage of other logger backends besides the default one (:logger_std_h from OTP). Warnings were added to Pleroma startup to warn about the usage of :logger, backends and additional logic was introduced to make addition of ExSyslogger to admin's configuration less dumb. Ref: https://hexdocs.pm/logger/1.15.0/Logger.html#module-backends-and-backwards-compatibility
This commit is contained in:
parent
dd2f0a32d8
commit
926cad3a76
6 changed files with 55 additions and 22 deletions
|
|
@ -132,11 +132,12 @@ config :pleroma, Pleroma.Web.Endpoint,
|
|||
"SameSite=Lax"
|
||||
]
|
||||
|
||||
# Configures Elixir's Logger
|
||||
config :logger, backends: [:console]
|
||||
# config :logger, :console has been changed in 1.15+ and split into
|
||||
# :default_handler and :default_formatter. It started emitting warnings in 1.19.
|
||||
# See https://hexdocs.pm/logger/1.19.0/Logger.html#module-backends-and-backwards-compatibility
|
||||
config :logger, :default_handler, level: :debug
|
||||
|
||||
config :logger, :console,
|
||||
level: :debug,
|
||||
config :logger, :default_formatter,
|
||||
format: "\n$time $metadata[$level] $message\n",
|
||||
metadata: [:actor, :path, :type, :user]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue