فهرست منبع

Merge pull request #7902 from DDDHuang/ddd_fix

fix: node info, log path only path
zhongwencool 3 سال پیش
والد
کامیت
0924c7dc13
2فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 1 1
      apps/emqx_management/src/emqx_mgmt_api_nodes.erl
  2. 1 1
      apps/emqx_management/test/emqx_mgmt_api_nodes_SUITE.erl

+ 1 - 1
apps/emqx_management/src/emqx_mgmt_api_nodes.erl

@@ -302,7 +302,7 @@ log_path() ->
     get_log_path(Configs).
     get_log_path(Configs).
 
 
 get_log_path([#{config := #{file := Path}} | _LoggerConfigs]) ->
 get_log_path([#{config := #{file := Path}} | _LoggerConfigs]) ->
-    Path;
+    filename:dirname(Path);
 get_log_path([_LoggerConfig | LoggerConfigs]) ->
 get_log_path([_LoggerConfig | LoggerConfigs]) ->
     get_log_path(LoggerConfigs);
     get_log_path(LoggerConfigs);
 get_log_path([]) ->
 get_log_path([]) ->

+ 1 - 1
apps/emqx_management/test/emqx_mgmt_api_nodes_SUITE.erl

@@ -75,7 +75,7 @@ t_log_path(_) ->
     {ok, NodeInfo} = emqx_mgmt_api_test_util:request_api(get, NodePath),
     {ok, NodeInfo} = emqx_mgmt_api_test_util:request_api(get, NodePath),
     #{<<"log_path">> := Path} = emqx_json:decode(NodeInfo, [return_maps]),
     #{<<"log_path">> := Path} = emqx_json:decode(NodeInfo, [return_maps]),
     ?assertEqual(
     ?assertEqual(
-        <<"emqx-test.log">>,
+        <<"log">>,
         filename:basename(Path)
         filename:basename(Path)
     ).
     ).