Merge pull request #12513 from SergeTupchiy/EMQX-11530-info-for-flooding-log-events

fix: set `info` level for potentially flooding log events
This commit is contained in:
SergeTupchiy 2024-02-15 12:19:44 +02:00 committed by GitHub
commit 2f7a939067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 5 deletions

View File

@ -184,7 +184,7 @@ log_result(#{username := Username}, Topic, Action, From, Result) ->
end,
case Result of
allow -> ?SLOG(info, (LogMeta())#{msg => "authorization_permission_allowed"});
deny -> ?SLOG(warning, (LogMeta())#{msg => "authorization_permission_denied"})
deny -> ?SLOG(info, (LogMeta())#{msg => "authorization_permission_denied"})
end.
%% @private Format authorization rules source.

View File

@ -613,7 +613,7 @@ process_publish(Packet = ?PUBLISH_PACKET(QoS, Topic, PacketId), Channel) ->
do_publish(PacketId, Msg, NChannel);
{error, Rc = ?RC_NOT_AUTHORIZED, NChannel} ->
?SLOG(
warning,
info,
#{
msg => "cannot_publish_to_topic",
reason => emqx_reason_codes:name(Rc)
@ -632,7 +632,7 @@ process_publish(Packet = ?PUBLISH_PACKET(QoS, Topic, PacketId), Channel) ->
end;
{error, Rc = ?RC_QUOTA_EXCEEDED, NChannel} ->
?SLOG(
warning,
info,
#{
msg => "cannot_publish_to_topic",
reason => emqx_reason_codes:name(Rc)

View File

@ -63,7 +63,7 @@ handle_event(ClientInfo, {dropped, Msg, #{reason := queue_full, logctx := Ctx}})
ok = inc_pd('send_msg.dropped', 1),
ok = inc_pd('send_msg.dropped.queue_full', 1),
?SLOG(
warning,
info,
Ctx#{
msg => "dropped_msg_due_to_mqueue_is_full",
payload => Msg#message.payload

View File

@ -85,7 +85,7 @@ check(_ConnInfo, AckProps) ->
{ok, #{max_connections := MaxClients}} ->
case check_max_clients_exceeded(MaxClients) of
true ->
?SLOG(error, #{msg => "connection_rejected_due_to_license_limit_reached"}),
?SLOG(info, #{msg => "connection_rejected_due_to_license_limit_reached"}),
{stop, {error, ?RC_QUOTA_EXCEEDED}};
false ->
{ok, AckProps}

View File

@ -0,0 +1 @@
Change level of several flooding log events from warning to info.