fix: filter disable file handler

This commit is contained in:
Zhongwen Deng 2023-05-09 17:50:06 +08:00
parent c901f3a9d4
commit 428cc45c69
1 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,12 @@ tr_file_handler({HandlerName, SubConf}) ->
}}.
logger_file_handlers(Conf) ->
maps:to_list(conf_get("log.file", Conf, #{})).
lists:filter(
fun({_Name, Handler}) ->
conf_get("enable", Handler, false)
end,
maps:to_list(conf_get("log.file", Conf, #{}))
).
conf_get(Key, Conf) -> emqx_schema:conf_get(Key, Conf).
conf_get(Key, Conf, Default) -> emqx_schema:conf_get(Key, Conf, Default).