From d0ad44d36419b7c7d1c7622631b8a9e722058b10 Mon Sep 17 00:00:00 2001 From: JianBo He Date: Thu, 27 Oct 2022 16:23:30 +0800 Subject: [PATCH] chore(auth-http): using warning level instead of error --- apps/emqx_auth_http/src/emqx_acl_http.erl | 8 ++++---- apps/emqx_auth_http/src/emqx_auth_http.erl | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/emqx_auth_http/src/emqx_acl_http.erl b/apps/emqx_auth_http/src/emqx_acl_http.erl index 4f9282a42..c4925dbdb 100644 --- a/apps/emqx_auth_http/src/emqx_acl_http.erl +++ b/apps/emqx_auth_http/src/emqx_acl_http.erl @@ -46,13 +46,13 @@ check_acl(ClientInfo, PubSub, Topic, _AclResult, #{acl := ACLParams = #{path := {ok, 200, <<"ignore">>} -> ok; {ok, 200, _Body} -> {stop, allow}; {ok, Code, _Body} -> - ?LOG(error, "Deny ~s to topic ~ts, username: ~ts, http response code: ~p", + ?LOG(warning, "Deny ~s to topic ~ts, username: ~ts, http response code: ~p", [PubSub, Topic, Username, Code]), {stop, deny}; {error, Error} -> - ?LOG(error, "Deny ~s to topic ~ts, username: ~ts, due to request " - "http server failure, path: ~p, error: ~0p", - [PubSub, Topic, Username, Path, Error]), + ?LOG(warning, "Deny ~s to topic ~ts, username: ~ts, due to request " + "http server failure, path: ~p, error: ~0p", + [PubSub, Topic, Username, Path, Error]), ok end. diff --git a/apps/emqx_auth_http/src/emqx_auth_http.erl b/apps/emqx_auth_http/src/emqx_auth_http.erl index 3e63ea597..c58eef836 100644 --- a/apps/emqx_auth_http/src/emqx_auth_http.erl +++ b/apps/emqx_auth_http/src/emqx_auth_http.erl @@ -47,15 +47,15 @@ check(ClientInfo, AuthResult, #{auth := AuthParms = #{path := Path}, anonymous => false, mountpoint => mountpoint(Body, ClientInfo)}}; {ok, Code, _Body} -> - ?LOG(error, "Deny connection from path: ~s, username: ~ts, http " - "response code: ~p", - [Path, Username, Code]), + ?LOG(warning, "Deny connection from path: ~s, username: ~ts, http " + "response code: ~p", + [Path, Username, Code]), {stop, AuthResult#{auth_result => http_to_connack_error(Code), anonymous => false}}; {error, Error} -> - ?LOG(error, "Deny connection from path: ~s, username: ~ts, due to " - "request http-server failed: ~0p", - [Path, Username, Error]), + ?LOG(warning, "Deny connection from path: ~s, username: ~ts, due to " + "request http-server failed: ~0p", + [Path, Username, Error]), %%FIXME later: server_unavailable is not right. {stop, AuthResult#{auth_result => server_unavailable, anonymous => false}} @@ -91,7 +91,7 @@ is_superuser(SuperParams = case request(PoolName, Method, Path, Headers, feedvar(Params, ClientInfo), Timeout, Retry) of {ok, 200, _Body} -> true; {ok, _Code, _Body} -> false; - {error, Error} -> ?LOG(error, "Request superuser path ~s, error: ~p", [Path, Error]), + {error, Error} -> ?LOG(warning, "Request superuser path ~s, error: ~p", [Path, Error]), false end.