In my Erlang application, I have the following configuration in app.config
:
[
{kernel,
[{logger,
[
%% Console logger
{handler, default, logger_std_h, #{}},
%% Disk logger for errors
{handler, disk_log, logger_disk_log_h, #{config => #{
file => "log/web_server.log",
type => wrap,
max_no_files => 5,
max_no_bytes => 2097152,
sync_mode_qlen => 2000, % If sync_mode_qlen is set to the same value as drop_mode_qlen,
drop_mode_qlen => 2000, % synchronous mode is disabled. That is, the handler always runs
flush_qlen => 5000, % in asynchronous mode, unless dropping or flushing is invoked.
overload_kill_enable => true
% Documentation about Overload protection, together with default values, can be found here:
% http://erlang.org/doc/apps/kernel/logger_chapter.html#protecting-the-handler-from-overload
},
formatter => {logger_formatter, #{
depth => 12,
chars_limit => 1024
}}
}
}
]}
]},
...]
I have tried to find the relevant documentation explaining how I can configure the Logger in my Elixir config files to achieve the above behaviour (or similar) for my Phoenix application. I have looked here: Logger — Logger v1.13.4
But there is no information to be found. Does anyone know where I can find an example config for disk logging in Elixir ?