After starting the Erlang shell with erl
I create a logger like so
4> Config = #{config => #{file => "./info.log"}, level => info}.
#{config => #{file => "./info.log"},level => info}
5> logger:add_handler(myhandler, logger_std_h, Config).
ok
Then if I try to log a warning message by logger:warn("foo").
it shows up in the log file. But if I try an info message by logger:info("foo").
it does not. Even though the log level has explicitly been set to info
in the Config.
erl
needs to be started with a kernel parameter to do this.
Starting it with erl -kernel logger_level info
works as expected.