aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kernel/src')
-rw-r--r--lib/kernel/src/application_controller.erl14
-rw-r--r--lib/kernel/src/error_logger.erl6
-rw-r--r--lib/kernel/src/kernel.app.src5
-rw-r--r--lib/kernel/src/logger.erl17
-rw-r--r--lib/kernel/src/logger_formatter.erl26
-rw-r--r--lib/kernel/src/logger_server.erl2
6 files changed, 37 insertions, 33 deletions
diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl
index d5a632ef6f..36479f4be6 100644
--- a/lib/kernel/src/application_controller.erl
+++ b/lib/kernel/src/application_controller.erl
@@ -1920,13 +1920,13 @@ info_started(Name, Node) ->
error_logger=>#{tag=>info_report,type=>progress}}).
info_exited(Name, Reason, Type) ->
- ?LOG_INFO(#{label=>{application_controller,exit},
- report=>[{application, Name},
- {exited, Reason},
- {type, Type}]},
- #{domain=>[otp],
- report_cb=>fun logger:format_otp_report/1,
- error_logger=>#{tag=>info_report,type=>std_info}}).
+ ?LOG_NOTICE(#{label=>{application_controller,exit},
+ report=>[{application, Name},
+ {exited, Reason},
+ {type, Type}]},
+ #{domain=>[otp],
+ report_cb=>fun logger:format_otp_report/1,
+ error_logger=>#{tag=>info_report,type=>std_info}}).
%%-----------------------------------------------------------------
%% Reply to all processes waiting this application to be started.
diff --git a/lib/kernel/src/error_logger.erl b/lib/kernel/src/error_logger.erl
index ef930317b1..a0bf87796b 100644
--- a/lib/kernel/src/error_logger.erl
+++ b/lib/kernel/src/error_logger.erl
@@ -317,7 +317,7 @@ info_report(Report) ->
Report :: report().
info_report(Type, Report) ->
- logger:log(info,
+ logger:log(notice,
#{label=>{?MODULE,info_report},
report=>Report},
meta(info_report,Type)).
@@ -338,7 +338,7 @@ info_msg(Format) ->
Data :: list().
info_msg(Format, Args) ->
- logger:log(info,
+ logger:log(notice,
#{label=>{?MODULE,info_msg},
format=>Format,
args=>Args},
@@ -358,7 +358,7 @@ error_info(Error) ->
false -> {"~p",[Error]}
end,
MyMeta = #{tag=>info,type=>Error},
- logger:log(info, Format, Args, #{?MODULE=>MyMeta,domain=>[Error]}).
+ logger:log(notice, Format, Args, #{?MODULE=>MyMeta,domain=>[Error]}).
%%-----------------------------------------------------------------
%% Create metadata
diff --git a/lib/kernel/src/kernel.app.src b/lib/kernel/src/kernel.app.src
index d873178f55..390f1fa42a 100644
--- a/lib/kernel/src/kernel.app.src
+++ b/lib/kernel/src/kernel.app.src
@@ -140,9 +140,8 @@
inet_db,
pg2]},
{applications, []},
- {env, [{logger_level, info},
- {logger_sasl_compatible, false},
- {logger_progress_reports, stop}
+ {env, [{logger_level, notice},
+ {logger_sasl_compatible, false}
]},
{mod, {kernel, []}},
{runtime_dependencies, ["erts-10.0", "stdlib-3.5", "sasl-3.0"]}
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index f6dc8ea397..e0832bf31c 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -710,15 +710,7 @@ get_default_handler_filters() ->
true ->
?DEFAULT_HANDLER_FILTERS([otp]);
false ->
- Extra =
- case application:get_env(kernel, logger_progress_reports, stop) of
- log ->
- [];
- stop ->
- [{stop_progress,
- {fun logger_filters:progress/2,stop}}]
- end,
- Extra ++ ?DEFAULT_HANDLER_FILTERS([otp,sasl])
+ ?DEFAULT_HANDLER_FILTERS([otp,sasl])
end.
get_logger_env() ->
@@ -726,17 +718,14 @@ get_logger_env() ->
%%%-----------------------------------------------------------------
%%% Internal
-do_log(Level,Msg,Meta) ->
- do_log_1(Level,Msg,Meta).
-
-do_log_1(Level,Msg,#{mfa:={Module,_,_}}=Meta) ->
+do_log(Level,Msg,#{mfa:={Module,_,_}}=Meta) ->
case logger_config:allow(?LOGGER_TABLE,Level,Module) of
true ->
log_allowed(#{},Level,Msg,Meta);
false ->
ok
end;
-do_log_1(Level,Msg,Meta) ->
+do_log(Level,Msg,Meta) ->
case logger_config:allow(?LOGGER_TABLE,Level) of
true ->
log_allowed(#{},Level,Msg,Meta);
diff --git a/lib/kernel/src/logger_formatter.erl b/lib/kernel/src/logger_formatter.erl
index 6eeac994ea..4ebd88ac2d 100644
--- a/lib/kernel/src/logger_formatter.erl
+++ b/lib/kernel/src/logger_formatter.erl
@@ -234,7 +234,7 @@ format_mfa(MFA) ->
maybe_add_legacy_header(Level,
#{time:=Timestamp}=Meta,
#{legacy_header:=true}=Config) ->
- #{title:=Title}=MyMeta = add_legacy_title(Level,maps:get(?MODULE,Meta,#{})),
+ #{title:=Title}=MyMeta = add_legacy_title(Level,Meta,Config),
{{Y,Mo,D},{H,Mi,S},Micro,UtcStr} =
timestamp_to_datetimemicro(Timestamp,Config),
Header =
@@ -244,11 +244,23 @@ maybe_add_legacy_header(Level,
maybe_add_legacy_header(_,Meta,_) ->
Meta.
-add_legacy_title(_Level,#{title:=_}=MyMeta) ->
+add_legacy_title(_Level,#{?MODULE:=#{title:=_}=MyMeta},_) ->
MyMeta;
-add_legacy_title(Level,MyMeta) ->
- Title = string:uppercase(atom_to_list(Level)) ++ " REPORT",
- MyMeta#{title=>Title}.
+add_legacy_title(Level,Meta,Config) ->
+ case maps:get(?MODULE,Meta,#{}) of
+ #{title:=_}=MyMeta ->
+ MyMeta;
+ MyMeta ->
+ TitleLevel =
+ case (Level=:=notice andalso maps:find(error_logger,Meta)) of
+ {ok,_} ->
+ maps:get(error_logger_notice_header,Config);
+ _ ->
+ Level
+ end,
+ Title = string:uppercase(atom_to_list(TitleLevel)) ++ " REPORT",
+ MyMeta#{title=>Title}
+ end.
month(1) -> "Jan";
month(2) -> "Feb";
@@ -268,6 +280,7 @@ month(12) -> "Dec".
add_default_config(Config0) ->
Default =
#{legacy_header=>false,
+ error_logger_notice_header=>info,
single_line=>true,
chars_limit=>unlimited,
time_designator=>$T},
@@ -352,6 +365,9 @@ do_check_config([{single_line,SL}|Config]) when is_boolean(SL) ->
do_check_config(Config);
do_check_config([{legacy_header,LH}|Config]) when is_boolean(LH) ->
do_check_config(Config);
+do_check_config([{error_logger_notice_header,ELNH}|Config]) when ELNH == info;
+ ELNH == notice ->
+ do_check_config(Config);
do_check_config([{report_cb,RCB}|Config]) when is_function(RCB,1) ->
do_check_config(Config);
do_check_config([{template,T}|Config]) ->
diff --git a/lib/kernel/src/logger_server.erl b/lib/kernel/src/logger_server.erl
index 6d4ab0925d..5da8f71420 100644
--- a/lib/kernel/src/logger_server.erl
+++ b/lib/kernel/src/logger_server.erl
@@ -357,7 +357,7 @@ do_set_config(Tid,Id,Config) ->
ok.
default_config(primary) ->
- #{level=>info,
+ #{level=>notice,
filters=>[],
filter_default=>log};
default_config(Id) ->