Fix logger initialization on OTP<21.3

This commit is contained in:
Evgeny Khramtsov 2019-10-23 16:41:27 +03:00
parent 1e30b85861
commit d300a87059
1 changed files with 2 additions and 2 deletions

View File

@ -120,14 +120,14 @@ start(Level) ->
end,
case logger:add_handler(ejabberd_log, logger_std_h,
#{level => all,
config => Config#{file => EjabberdLog},
config => Config#{type => {file, EjabberdLog}},
formatter => {logger_formatter, FileFmtConfig}}) of
ok -> ok;
{error, {already_exist, _}} -> ok
end,
case logger:add_handler(error_log, logger_std_h,
#{level => error,
config => Config#{file => ErrorLog},
config => Config#{type => {file, ErrorLog}},
formatter => {logger_formatter, FileFmtConfig}}) of
ok -> ok;
{error, {already_exist, _}} -> ok