Logging to a file in Elixir test environment
The default configuration for a logger in the test env is:
config :logger, level: :warn
That is, of the four logging levels (defug, info, warn and error) only log warnings and errors.
By default this logger logs to the console making the below redundant:
config :logger, level: :warn, backends: [:console]
:console
is the only option available by default, but there are other backends
available via hex package.
With hex package logger_file_backend you might have a different config:
config :logger, backends: [{LoggerFileBackend, :error_log}]
config :logger, :error_log, path: 'log/here.log'
Tweet