aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/logger.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2018-05-18 11:54:32 +0200
committerSiri Hansen <[email protected]>2018-05-23 11:11:13 +0200
commitbe959158a9ebe4b4ed8c336b969ac0c0e9399312 (patch)
tree1961fcf517dde4d42e7dd59a9803eaff89842d59 /lib/kernel/src/logger.erl
parenta9a6b803a60793d42a74e0f1693a7594dffb6bc3 (diff)
downloadotp-be959158a9ebe4b4ed8c336b969ac0c0e9399312.tar.gz
otp-be959158a9ebe4b4ed8c336b969ac0c0e9399312.tar.bz2
otp-be959158a9ebe4b4ed8c336b969ac0c0e9399312.zip
Set legacy_header=true for kernel's default handler only
Diffstat (limited to 'lib/kernel/src/logger.erl')
-rw-r--r--lib/kernel/src/logger.erl10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/kernel/src/logger.erl b/lib/kernel/src/logger.erl
index 281521ae6e..51743822af 100644
--- a/lib/kernel/src/logger.erl
+++ b/lib/kernel/src/logger.erl
@@ -677,7 +677,8 @@ init_default_config(Type) when Type==standard_io;
Type==standard_error;
element(1,Type)==file ->
Env = get_logger_env(),
- DefaultConfig = #{logger_std_h=>#{type=>Type}},
+ DefaultFormatter = #{formatter=>{?DEFAULT_FORMATTER,?DEFAULT_FORMAT_CONFIG}},
+ DefaultConfig = DefaultFormatter#{logger_std_h=>#{type=>Type}},
NewLoggerEnv =
case lists:keyfind(default, 2, Env) of
{handler, default, Module, Config} ->
@@ -687,6 +688,13 @@ init_default_config(Type) when Type==standard_io;
%% if not configured by user AND the default
%% handler is still the logger_std_h.
{handler, default, Module, maps:merge(DefaultConfig,Config)};
+ ({handler, default, logger_disk_log_h, _}) ->
+ %% Add default formatter. The point of this
+ %% is to get the expected formatter config
+ %% for the default handler, since this
+ %% differs from the default values that
+ %% logger_formatter itself adds.
+ {handler, default, logger_disk_log_h, maps:merge(DefaultFormatter,Config)};
(Other) ->
Other
end, Env);