(Decided to split off from this post to be in proper forum)
Hi – I’m attempting to use the OTP standard logger to log messages to file. I’ve so far been successful in generating the log file, but none of my log messages get written to the file. I mostly followed the Logger documentation
Unsure if I need to also adjust the backends config value. Are there any glaring errors in my config?
# runnable.exs
def start(_type, _args) do
:logger.add_handlers(:runnable)
Logger.info("Starting application...")
children = [
Greeting
]
Supervisor.start_link(children, strategy: :one_for_one)
end
# config.exs
config :logger,
backends: [:console]
config :logger, :console,
level: :info
config :runnable, :logger,
[
{:handler, :default, :logger_std_h,
%{level: :info,
config:
%{file: 'test.log'}
}
}
]