25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

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

View File

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