From 4a920dca5a07c9c5174c62c0a0b78eff39514fd2 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Fri, 15 Mar 2019 11:51:48 +0100 Subject: [PATCH] Add newline to error_logger log format --- src/ejabberd_system_monitor.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ejabberd_system_monitor.erl b/src/ejabberd_system_monitor.erl index 59ba6f806..e5af257a8 100644 --- a/src/ejabberd_system_monitor.erl +++ b/src/ejabberd_system_monitor.erl @@ -94,7 +94,7 @@ handle_event({set_alarm, {process_memory_high_watermark, Pid}}, State) -> case proc_stat(Pid, get_app_pids()) of #proc_stat{name = Name} = ProcStat -> error_logger:warning_msg( - "Process ~p consumes more than 5% of OS memory (~s)", + "Process ~p consumes more than 5% of OS memory (~s)~n", [Name, format_proc(ProcStat)]), handle_overload(State), {ok, State}; @@ -104,7 +104,7 @@ handle_event({set_alarm, {process_memory_high_watermark, Pid}}, State) -> handle_event({clear_alarm, process_memory_high_watermark}, State) -> {ok, State}; handle_event(Event, State) -> - error_logger:warning_msg("unexpected event: ~p", [Event]), + error_logger:warning_msg("unexpected event: ~p~n", [Event]), {ok, State}. handle_call(_Request, State) -> @@ -114,7 +114,7 @@ handle_info({timeout, _TRef, handle_overload}, State) -> handle_overload(State), {ok, restart_timer(State)}; handle_info(Info, State) -> - error_logger:warning_msg("unexpected info: ~p", [Info]), + error_logger:warning_msg("unexpected info: ~p~n", [Info]), {ok, State}. terminate(_Reason, _State) -> @@ -141,7 +141,7 @@ handle_overload(_State, Procs) -> "The system is overloaded with ~b messages " "queued by ~b process(es) (~b%) " "from the following applications: ~s; " - "the top processes are:~n~s", + "the top processes are:~n~s~n", [TotalMsgs, ProcsNum, round(ProcsNum*100/length(Procs)), format_apps(Apps), @@ -274,7 +274,7 @@ do_kill(Stats, Threshold) -> true -> error_logger:warning_msg( "Unable to kill process ~p from whitelisted " - "application ~p", [Name, App]), + "application ~p~n", [Name, App]), false; false -> case kill_proc(Name) of @@ -291,7 +291,7 @@ do_kill(Stats, Threshold) -> TotalKilled = length(Killed), if TotalKilled > 0 -> error_logger:error_msg( - "Killed ~b process(es) consuming more than ~b message(s) each", + "Killed ~b process(es) consuming more than ~b message(s) each~n", [TotalKilled, Threshold]); true -> ok