chore: remove result field for CLI audit logs

This commit is contained in:
JianBo He 2023-09-26 19:24:35 +08:00
parent a73c3b8e1e
commit 5e6397b843
2 changed files with 10 additions and 13 deletions

View File

@ -146,7 +146,7 @@ run_command(Cmd, Args) when is_atom(Cmd) ->
audit_log(
audit_level(Result, Duration),
"from_cli",
#{duration_ms => Duration, result => Result, cmd => Cmd, args => Args, node => node()}
#{duration_ms => Duration, cmd => Cmd, args => Args, node => node()}
),
Result.

View File

@ -28,9 +28,16 @@ fields("node") ->
fields("log") ->
redefine_log(emqx_conf_schema:fields("log"));
fields("log_audit_handler") ->
CommonConfs = emqx_conf_schema:log_handler_common_confs(file, #{}),
CommonConfs1 = lists:filter(
fun({Key, _}) ->
not lists:member(Key, ["level", "formatter"])
end,
CommonConfs
),
[
{"level",
sc(
hoconsc:mk(
emqx_conf_schema:log_level(),
#{
default => info,
@ -72,17 +79,7 @@ fields("log_audit_handler") ->
importance => ?IMPORTANCE_MEDIUM
}
)}
] ++
%% Only support json
lists:keydelete(
"level",
1,
lists:keydelete(
"formatter",
1,
log_handler_common_confs(file, #{})
)
);
] ++ CommonConfs1;
fields(Name) ->
ee_delegate(fields, ?EE_SCHEMA_MODULES, Name).