From 0fbf7715434f295360b4fe84dd0fa4472dacdfaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=AD=90=E5=8D=9A?= <349832309@qq.com> Date: Wed, 27 Mar 2019 11:07:58 +0800 Subject: [PATCH] Readjust log level into error when got unexpected message --- src/emqx_alarm_handler.erl | 2 +- src/emqx_banned.erl | 6 +++--- src/emqx_broker.erl | 8 ++++---- src/emqx_broker_helper.erl | 6 +++--- src/emqx_client.erl | 2 +- src/emqx_cm.erl | 6 +++--- src/emqx_connection.erl | 6 +++--- src/emqx_ctl.erl | 6 +++--- src/emqx_hooks.erl | 6 +++--- src/emqx_pool.erl | 6 +++--- src/emqx_router.erl | 6 +++--- src/emqx_router_helper.erl | 6 +++--- src/emqx_session.erl | 6 +++--- src/emqx_session_sup.erl | 4 ++-- src/emqx_shared_sub.erl | 6 +++--- src/emqx_sm.erl | 6 +++--- src/emqx_sm_registry.erl | 6 +++--- src/emqx_stats.erl | 6 +++--- src/emqx_sys.erl | 6 +++--- src/emqx_sys_mon.erl | 6 +++--- src/emqx_tracer.erl | 6 +++--- src/emqx_ws_connection.erl | 2 +- src/emqx_zone.erl | 6 +++--- 23 files changed, 63 insertions(+), 63 deletions(-) diff --git a/src/emqx_alarm_handler.erl b/src/emqx_alarm_handler.erl index 3cb6d7fa0..66e169b17 100644 --- a/src/emqx_alarm_handler.erl +++ b/src/emqx_alarm_handler.erl @@ -103,7 +103,7 @@ handle_event({set_alarm, Alarm = {AlarmId, AlarmDesc}}, State) -> set_alarm_(AlarmId, AlarmDesc), {ok, State}; handle_event({clear_alarm, AlarmId}, State) -> - ?LOG(notice, "~p clear", [AlarmId]), + ?LOG(notice, "[Alarm Handler] ~p clear", [AlarmId]), emqx_broker:safe_publish(alarm_msg(topic(clear, maybe_to_binary(AlarmId)), <<"">>)), clear_alarm_(AlarmId), {ok, State}; diff --git a/src/emqx_banned.erl b/src/emqx_banned.erl index bf0fa4254..ab21bce50 100644 --- a/src/emqx_banned.erl +++ b/src/emqx_banned.erl @@ -88,11 +88,11 @@ init([]) -> {ok, ensure_expiry_timer(#{expiry_timer => undefined})}. handle_call(Req, _From, State) -> - ?LOG(notice, "[Banned] unexpected call: ~p", [Req]), + ?LOG(error, "[Banned] unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Banned] unexpected msg: ~p", [Msg]), + ?LOG(error, "[Banned] unexpected msg: ~p", [Msg]), {noreply, State}. handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) -> @@ -100,7 +100,7 @@ handle_info({timeout, TRef, expire}, State = #{expiry_timer := TRef}) -> {noreply, ensure_expiry_timer(State), hibernate}; handle_info(Info, State) -> - ?LOG(notice, "[Banned] unexpected info: ~p", [Info]), + ?LOG(error, "[Banned] unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #{expiry_timer := TRef}) -> diff --git a/src/emqx_broker.erl b/src/emqx_broker.erl index 618bf778e..5f66e5810 100644 --- a/src/emqx_broker.erl +++ b/src/emqx_broker.erl @@ -209,7 +209,7 @@ safe_publish(Msg) when is_record(Msg, message) -> publish(Msg) catch _:Error:Stacktrace -> - ?LOG(error, "[Broker] publish error: ~p~n~p~n~p", [Error, Msg, Stacktrace]) + ?LOG(error, "[Broker] Publish error: ~p~n~p~n~p", [Error, Msg, Stacktrace]) after ok end. @@ -424,7 +424,7 @@ handle_call({subscribe, Topic, I}, _From, State) -> {reply, Ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Broker] unexpected call: ~p", [Req]), + ?LOG(error, "[Broker] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({subscribe, Topic}, State) -> @@ -454,11 +454,11 @@ handle_cast({unsubscribed, Topic, I}, State) -> {noreply, State}; handle_cast(Msg, State) -> - ?LOG(notice, "[Broker] unexpected cast: ~p", [Msg]), + ?LOG(error, "[Broker] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[Broker] unexpected info: ~p", [Info]), + ?LOG(error, "[Broker] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #{pool := Pool, id := Id}) -> diff --git a/src/emqx_broker_helper.erl b/src/emqx_broker_helper.erl index 435ffd9c3..8ece1805b 100644 --- a/src/emqx_broker_helper.erl +++ b/src/emqx_broker_helper.erl @@ -110,7 +110,7 @@ init([]) -> {ok, #{pmon => emqx_pmon:new()}}. handle_call(Req, _From, State) -> - ?LOG(notice, "[Broker Helper] unexpected call: ~p", [Req]), + ?LOG(error, "[Broker Helper] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({register_sub, SubPid, SubId}, State = #{pmon := PMon}) -> @@ -119,7 +119,7 @@ handle_cast({register_sub, SubPid, SubId}, State = #{pmon := PMon}) -> {noreply, State#{pmon := emqx_pmon:monitor(SubPid, PMon)}}; handle_cast(Msg, State) -> - ?LOG(notice, "[Broker Helper] unexpected cast: ~p", [Msg]), + ?LOG(error, "[Broker Helper] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #{pmon := PMon}) -> @@ -130,7 +130,7 @@ handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #{pmon := PMon}) {noreply, State#{pmon := PMon1}}; handle_info(Info, State) -> - ?LOG(notice, "[Broker Helper] unexpected info: ~p", [Info]), + ?LOG(error, "[Broker Helper] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_client.erl b/src/emqx_client.erl index eab5d2b20..75b384fcb 100644 --- a/src/emqx_client.erl +++ b/src/emqx_client.erl @@ -929,7 +929,7 @@ handle_event(info, {inet_reply, _Sock, {error, Reason}}, _, State) -> {stop, {shutdown, Reason}, State}; handle_event(EventType, EventContent, StateName, _StateData) -> - ?LOG(notice, "[Client] State: ~s, Unexpected Event: (~p, ~p)", + ?LOG(error, "[Client] State: ~s, Unexpected Event: (~p, ~p)", [StateName, EventType, EventContent]), keep_state_and_data. diff --git a/src/emqx_cm.erl b/src/emqx_cm.erl index 76e3ebdc4..a915fdddb 100644 --- a/src/emqx_cm.erl +++ b/src/emqx_cm.erl @@ -159,7 +159,7 @@ init([]) -> {ok, #{conn_pmon => emqx_pmon:new()}}. handle_call(Req, _From, State) -> - ?LOG(notice, "[CM] unexpected call: ~p", [Req]), + ?LOG(error, "[CM] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({notify, {registered, ClientId, ConnPid}}, State = #{conn_pmon := PMon}) -> @@ -169,7 +169,7 @@ handle_cast({notify, {unregistered, ConnPid}}, State = #{conn_pmon := PMon}) -> {noreply, State#{conn_pmon := emqx_pmon:demonitor(ConnPid, PMon)}}; handle_cast(Msg, State) -> - ?LOG(notice, "[CM] unexpected cast: ~p", [Msg]), + ?LOG(error, "[CM] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({'DOWN', _MRef, process, Pid, _Reason}, State = #{conn_pmon := PMon}) -> @@ -180,7 +180,7 @@ handle_info({'DOWN', _MRef, process, Pid, _Reason}, State = #{conn_pmon := PMon} {noreply, State#{conn_pmon := PMon1}}; handle_info(Info, State) -> - ?LOG(notice, "[CM] unexpected info: ~p", [Info]), + ?LOG(error, "[CM] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_connection.erl b/src/emqx_connection.erl index c770ebb2d..e9cfd6ae4 100644 --- a/src/emqx_connection.erl +++ b/src/emqx_connection.erl @@ -286,12 +286,12 @@ handle({call, From}, session, State = #state{proto_state = ProtoState}) -> reply(From, emqx_protocol:session(ProtoState), State); handle({call, From}, Req, State) -> - ?LOG(notice, "[Connection] Unexpected call: ~p", [Req]), + ?LOG(error, "[Connection] Unexpected call: ~p", [Req]), reply(From, ignored, State); %% Handle cast handle(cast, Msg, State) -> - ?LOG(notice, "[Connection] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Connection] Unexpected cast: ~p", [Msg]), {keep_state, State}; %% Handle Incoming @@ -361,7 +361,7 @@ handle(info, {shutdown, Reason}, State) -> shutdown(Reason, State); handle(info, Info, State) -> - ?LOG(notice, "[Connection] Unexpected info: ~p", [Info]), + ?LOG(error, "[Connection] Unexpected info: ~p", [Info]), {keep_state, State}. code_change(_Vsn, State, Data, _Extra) -> diff --git a/src/emqx_ctl.erl b/src/emqx_ctl.erl index 6566c6880..4746175b3 100644 --- a/src/emqx_ctl.erl +++ b/src/emqx_ctl.erl @@ -107,7 +107,7 @@ init([]) -> {ok, #state{seq = 0}}. handle_call(Req, _From, State) -> - ?LOG(notice, "[Ctl] Unexpected call: ~p", [Req]), + ?LOG(error, "[Ctl] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({register_command, Cmd, MF, Opts}, State = #state{seq = Seq}) -> @@ -124,11 +124,11 @@ handle_cast({unregister_command, Cmd}, State) -> noreply(State); handle_cast(Msg, State) -> - ?LOG(notice, "[Ctl] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Ctl] Unexpected cast: ~p", [Msg]), noreply(State). handle_info(Info, State) -> - ?LOG(notice, "[Ctl] Unexpected info: ~p", [Info]), + ?LOG(error, "[Ctl] Unexpected info: ~p", [Info]), noreply(State). terminate(_Reason, _State) -> diff --git a/src/emqx_hooks.erl b/src/emqx_hooks.erl index b4ddc6151..6d448d2f3 100644 --- a/src/emqx_hooks.erl +++ b/src/emqx_hooks.erl @@ -181,7 +181,7 @@ handle_call({add, HookPoint, Callback = #callback{action = Action}}, _From, Stat {reply, Reply, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Hooks] Unexpected call: ~p", [Req]), + ?LOG(error, "[Hooks] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({del, HookPoint, Action}, State) -> @@ -194,11 +194,11 @@ handle_cast({del, HookPoint, Action}, State) -> {noreply, State}; handle_cast(Msg, State) -> - ?LOG(notice, "[Hooks] Unexpected msg: ~p", [Msg]), + ?LOG(error, "[Hooks] Unexpected msg: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[Hooks] Unexpected info: ~p", [Info]), + ?LOG(error, "[Hooks] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_pool.erl b/src/emqx_pool.erl index bfd09a0fc..b78479f5c 100644 --- a/src/emqx_pool.erl +++ b/src/emqx_pool.erl @@ -97,7 +97,7 @@ handle_call({submit, Task}, _From, State) -> {reply, catch run(Task), State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Pool] Unexpected call: ~p", [Req]), + ?LOG(error, "[Pool] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({async_submit, Task}, State) -> @@ -108,11 +108,11 @@ handle_cast({async_submit, Task}, State) -> {noreply, State}; handle_cast(Msg, State) -> - ?LOG(notice, "[Pool] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Pool] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[Pool] Unexpected info: ~p", [Info]), + ?LOG(error, "[Pool] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #{pool := Pool, id := Id}) -> diff --git a/src/emqx_router.erl b/src/emqx_router.erl index 1015fcfef..8eb65169c 100644 --- a/src/emqx_router.erl +++ b/src/emqx_router.erl @@ -198,15 +198,15 @@ handle_call({delete_route, Topic, Dest}, _From, State) -> {reply, Ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Router] Unexpected call: ~p", [Req]), + ?LOG(error, "[Router] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Router] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Router] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[Router] Unexpected info: ~p", [Info]), + ?LOG(error, "[Router] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #{pool := Pool, id := Id}) -> diff --git a/src/emqx_router_helper.erl b/src/emqx_router_helper.erl index 363933aa7..0b31929fb 100644 --- a/src/emqx_router_helper.erl +++ b/src/emqx_router_helper.erl @@ -103,11 +103,11 @@ init([]) -> {ok, #{nodes => Nodes}, hibernate}. handle_call(Req, _From, State) -> - ?LOG(notice, "[Router Helper] Unexpected call: ~p", [Req]), + ?LOG(error, "[Router Helper] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Router Helper] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Router Helper] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({mnesia_table_event, {write, {?ROUTING_NODE, Node, _}, _}}, State = #{nodes := Nodes}) -> @@ -141,7 +141,7 @@ handle_info({membership, _Event}, State) -> {noreply, State}; handle_info(Info, State) -> - ?LOG(notice, "[Route Helper] Unexpected info: ~p", [Info]), + ?LOG(error, "[Route Helper] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_session.erl b/src/emqx_session.erl index 2cc1c2945..df3da8258 100644 --- a/src/emqx_session.erl +++ b/src/emqx_session.erl @@ -478,7 +478,7 @@ handle_call(close, _From, State) -> {stop, normal, ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Session] Unexpected call: ~p", [Req]), + ?LOG(error, "[Session] Unexpected call: ~p", [Req]), {reply, ignored, State}. %% SUBSCRIBE: @@ -587,7 +587,7 @@ handle_cast({update_expiry_interval, Interval}, State) -> {noreply, State#state{expiry_interval = Interval}}; handle_cast(Msg, State) -> - ?LOG(notice, "[Session] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Session] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({dispatch, Topic, Msg}, State) when is_record(Msg, message) -> @@ -668,7 +668,7 @@ handle_info({'EXIT', Pid, Reason}, State = #state{conn_pid = ConnPid}) -> {noreply, State}; handle_info(Info, State) -> - ?LOG(notice, "[Session] Unexpected info: ~p", [Info]), + ?LOG(error, "[Session] Unexpected info: ~p", [Info]), {noreply, State}. terminate(Reason, #state{will_msg = WillMsg, diff --git a/src/emqx_session_sup.erl b/src/emqx_session_sup.erl index 8422a2a70..ad721d5fd 100644 --- a/src/emqx_session_sup.erl +++ b/src/emqx_session_sup.erl @@ -101,11 +101,11 @@ handle_call(count_sessions, _From, State = #state{sessions = SessMap}) -> {reply, maps:size(SessMap), State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Session Supervisor] Unexpected call: ~p", [Req]), + ?LOG(error, "[Session Supervisor] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Session Supervisor] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Session Supervisor] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({'EXIT', Pid, _Reason}, State = #state{sessions = SessMap, clean_down = CleanDown}) -> diff --git a/src/emqx_shared_sub.erl b/src/emqx_shared_sub.erl index 7fb18533b..5f1962542 100644 --- a/src/emqx_shared_sub.erl +++ b/src/emqx_shared_sub.erl @@ -310,11 +310,11 @@ handle_call({unsubscribe, Group, Topic, SubPid}, _From, State) -> {reply, ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Shared Sub] Unexpected call: ~p", [Req]), + ?LOG(error, "[Shared Sub] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Shared Sub] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Shared Sub] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({mnesia_table_event, {write, NewRecord, _}}, State = #state{pmon = PMon}) -> @@ -334,7 +334,7 @@ handle_info({'DOWN', _MRef, process, SubPid, _Reason}, State = #state{pmon = PMo {noreply, update_stats(State#state{pmon = emqx_pmon:erase(SubPid, PMon)})}; handle_info(Info, State) -> - ?LOG(notice, "[Shared Sub] Unexpected info: ~p", [Info]), + ?LOG(error, "[Shared Sub] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_sm.erl b/src/emqx_sm.erl index b3a687ba1..4319b6ccb 100644 --- a/src/emqx_sm.erl +++ b/src/emqx_sm.erl @@ -250,15 +250,15 @@ init([]) -> {ok, #{}}. handle_call(Req, _From, State) -> - ?LOG(notice, "[SM] Unexpected call: ~p", [Req]), + ?LOG(error, "[SM] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[SM] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[SM] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[SM] Unexpected info: ~p", [Info]), + ?LOG(error, "[SM] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_sm_registry.erl b/src/emqx_sm_registry.erl index 3c071a43f..ccacc9907 100644 --- a/src/emqx_sm_registry.erl +++ b/src/emqx_sm_registry.erl @@ -96,11 +96,11 @@ init([]) -> {ok, #{}}. handle_call(Req, _From, State) -> - ?LOG(notice, "[Registry] Unexpected call: ~p", [Req]), + ?LOG(error, "[Registry] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Registry] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Registry] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({membership, {mnesia, down, Node}}, State) -> @@ -114,7 +114,7 @@ handle_info({membership, _Event}, State) -> {noreply, State}; handle_info(Info, State) -> - ?LOG(notice, "[Registry] Unexpected info: ~p", [Info]), + ?LOG(error, "[Registry] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_stats.erl b/src/emqx_stats.erl index e5113f1c5..926db5b04 100644 --- a/src/emqx_stats.erl +++ b/src/emqx_stats.erl @@ -181,7 +181,7 @@ start_timer(#state{tick_ms = Ms} = State) -> handle_call(stop, _From, State) -> {stop, normal, _Reply = ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Stats] Unexpected call: ~p", [Req]), + ?LOG(error, "[Stats] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({setstat, Stat, MaxStat, Val}, State) -> @@ -209,7 +209,7 @@ handle_cast({cancel_update, Name}, State = #state{updates = Updates}) -> {noreply, State#state{updates = lists:keydelete(Name, #update.name, Updates)}}; handle_cast(Msg, State) -> - ?LOG(notice, "[Stats] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Stats] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({timeout, TRef, tick}, State = #state{timer = TRef, updates = Updates}) -> @@ -228,7 +228,7 @@ handle_info({timeout, TRef, tick}, State = #state{timer = TRef, updates = Update {noreply, start_timer(State#state{updates = Updates1}), hibernate}; handle_info(Info, State) -> - ?LOG("notice, [Stats] Unexpected info: ~p", [Info]), + ?LOG("error, [Stats] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #state{timer = TRef}) -> diff --git a/src/emqx_sys.erl b/src/emqx_sys.erl index 0b5285a94..e5b718b05 100644 --- a/src/emqx_sys.erl +++ b/src/emqx_sys.erl @@ -117,11 +117,11 @@ handle_call(uptime, _From, State) -> {reply, uptime(State), State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[SYS] Unexpected call: ~p", [Req]), + ?LOG(error, "[SYS] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[SYS] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[SYS] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({timeout, TRef, heartbeat}, State = #state{heartbeat = TRef}) -> @@ -138,7 +138,7 @@ handle_info({timeout, TRef, tick}, State = #state{ticker = TRef, version = Versi {noreply, tick(State), hibernate}; handle_info(Info, State) -> - ?LOG(notice, "[SYS] Unexpected info: ~p", [Info]), + ?LOG(error, "[SYS] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, #state{heartbeat = TRef1, ticker = TRef2}) -> diff --git a/src/emqx_sys_mon.erl b/src/emqx_sys_mon.erl index 1c139e1ab..03cc95819 100644 --- a/src/emqx_sys_mon.erl +++ b/src/emqx_sys_mon.erl @@ -88,11 +88,11 @@ parse_opt([_Opt|Opts], Acc) -> parse_opt(Opts, Acc). handle_call(Req, _From, State) -> - ?LOG(notice, "[SYSMON] Unexpected call: ~p", [Req]), + ?LOG(error, "[SYSMON] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[SYSMON] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[SYSMON] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info({monitor, Pid, long_gc, Info}, State) -> @@ -147,7 +147,7 @@ handle_info({timeout, _Ref, reset}, State) -> {noreply, State#{events := []}, hibernate}; handle_info(Info, State) -> - ?LOG(notice, "[SYSMON] Unexpected Info: ~p", [Info]), + ?LOG(error, "[SYSMON] Unexpected Info: ~p", [Info]), {noreply, State}. terminate(_Reason, #{timer := TRef}) -> diff --git a/src/emqx_tracer.erl b/src/emqx_tracer.erl index b4f16f9d5..464a28ad2 100644 --- a/src/emqx_tracer.erl +++ b/src/emqx_tracer.erl @@ -136,15 +136,15 @@ handle_call(lookup_traces, _From, State = #state{traces = Traces}) -> {reply, [{Who, LogFile} || {Who, LogFile} <- maps:to_list(Traces)], State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Tracer] Unexpected call: ~p", [Req]), + ?LOG(error, "[Tracer] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast(Msg, State) -> - ?LOG(notice, "[Tracer] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Tracer] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(Info, State) -> - ?LOG(notice, "[Tracer] Unexpected info: ~p", [Info]), + ?LOG(error, "[Tracer] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) -> diff --git a/src/emqx_ws_connection.erl b/src/emqx_ws_connection.erl index 2524d0d41..f44db708f 100644 --- a/src/emqx_ws_connection.erl +++ b/src/emqx_ws_connection.erl @@ -272,7 +272,7 @@ websocket_info({shutdown, Reason}, State) -> shutdown(Reason, State); websocket_info(Info, State) -> - ?LOG(notice, "[WS Connection] Unexpected info: ~p", [Info]), + ?LOG(error, "[WS Connection] Unexpected info: ~p", [Info]), {ok, State}. terminate(SockError, _Req, #state{keepalive = Keepalive, diff --git a/src/emqx_zone.erl b/src/emqx_zone.erl index 65d9c6b4f..25bace1f2 100644 --- a/src/emqx_zone.erl +++ b/src/emqx_zone.erl @@ -92,7 +92,7 @@ handle_call(force_reload, _From, State) -> {reply, ok, State}; handle_call(Req, _From, State) -> - ?LOG(notice, "[Zone] Unexpected call: ~p", [Req]), + ?LOG(error, "[Zone] Unexpected call: ~p", [Req]), {reply, ignored, State}. handle_cast({set_env, Zone, Key, Val}, State) -> @@ -100,7 +100,7 @@ handle_cast({set_env, Zone, Key, Val}, State) -> {noreply, State}; handle_cast(Msg, State) -> - ?LOG(notice, "[Zone] Unexpected cast: ~p", [Msg]), + ?LOG(error, "[Zone] Unexpected cast: ~p", [Msg]), {noreply, State}. handle_info(reload, State) -> @@ -108,7 +108,7 @@ handle_info(reload, State) -> {noreply, ensure_reload_timer(State#{timer := undefined}), hibernate}; handle_info(Info, State) -> - ?LOG(notice, "[Zone] Unexpected info: ~p", [Info]), + ?LOG(error, "[Zone] Unexpected info: ~p", [Info]), {noreply, State}. terminate(_Reason, _State) ->