Hi,
I’m struggling to log an exception by using :logger directly.
I’ve created a new project, in application.ex
I’m adding handler, it successfully logs regular Logger.error/1
:logger.error/1
but completely ignores raise "x"
application.ex
defmodule Odin.Application do
use Application
@impl true
def start(_type, _args) do
children = [
]
:ok =
:logger.add_handler(
Odin,
:logger_std_h,
%{
config: %{type: :file, file: 'log.log', max_no_bytes: 100_000_000},
level: :debug
}
)
opts = [strategy: :one_for_one, name: Odin.Supervisor]
Supervisor.start_link(children, opts)
end
end
Forgot to mention OTP and Elixir:
Erlang/OTP 24 [erts-12.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit] [dtrace]
IEx 1.13.1 (compiled with Erlang/OTP 24)