test: nodes's log test failed
This commit is contained in:
parent
ad111a27f9
commit
c901f3a9d4
|
|
@ -151,7 +151,7 @@ log_path() ->
|
||||||
Configs = logger:get_handler_config(),
|
Configs = logger:get_handler_config(),
|
||||||
case get_log_path(Configs) of
|
case get_log_path(Configs) of
|
||||||
undefined ->
|
undefined ->
|
||||||
<<"log.file_handler.default.enable is false, not logging to file.">>;
|
<<"log.file.enable is false, not logging to file.">>;
|
||||||
Path ->
|
Path ->
|
||||||
iolist_to_binary(filename:join(RootDir, Path))
|
iolist_to_binary(filename:join(RootDir, Path))
|
||||||
end.
|
end.
|
||||||
|
|
|
||||||
|
|
@ -34,8 +34,8 @@ init_per_testcase(t_log_path, Config) ->
|
||||||
emqx_config_logger:add_handler(),
|
emqx_config_logger:add_handler(),
|
||||||
Log = emqx_conf:get_raw([log], #{}),
|
Log = emqx_conf:get_raw([log], #{}),
|
||||||
File = "log/emqx-test.log",
|
File = "log/emqx-test.log",
|
||||||
Log1 = emqx_utils_maps:deep_put([<<"file_handlers">>, <<"default">>, <<"enable">>], Log, true),
|
Log1 = emqx_utils_maps:deep_put([<<"file">>, <<"default">>, <<"enable">>], Log, true),
|
||||||
Log2 = emqx_utils_maps:deep_put([<<"file_handlers">>, <<"default">>, <<"file">>], Log1, File),
|
Log2 = emqx_utils_maps:deep_put([<<"file">>, <<"default">>, <<"to">>], Log1, File),
|
||||||
{ok, #{}} = emqx_conf:update([log], Log2, #{rawconf_with_defaults => true}),
|
{ok, #{}} = emqx_conf:update([log], Log2, #{rawconf_with_defaults => true}),
|
||||||
Config;
|
Config;
|
||||||
init_per_testcase(_, Config) ->
|
init_per_testcase(_, Config) ->
|
||||||
|
|
@ -43,7 +43,7 @@ init_per_testcase(_, Config) ->
|
||||||
|
|
||||||
end_per_testcase(t_log_path, Config) ->
|
end_per_testcase(t_log_path, Config) ->
|
||||||
Log = emqx_conf:get_raw([log], #{}),
|
Log = emqx_conf:get_raw([log], #{}),
|
||||||
Log1 = emqx_utils_maps:deep_put([<<"file_handlers">>, <<"default">>, <<"enable">>], Log, false),
|
Log1 = emqx_utils_maps:deep_put([<<"file">>, <<"default">>, <<"enable">>], Log, false),
|
||||||
{ok, #{}} = emqx_conf:update([log], Log1, #{rawconf_with_defaults => true}),
|
{ok, #{}} = emqx_conf:update([log], Log1, #{rawconf_with_defaults => true}),
|
||||||
emqx_config_logger:remove_handler(),
|
emqx_config_logger:remove_handler(),
|
||||||
Config;
|
Config;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue