fix(logging): add line-break after each JSON log

This commit is contained in:
Zaiming Shi 2021-05-09 11:11:56 +02:00 committed by Zaiming (Stone) Shi
parent 29bbc0802b
commit 1cabd140c5
3 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,7 @@
{application, emqx,
[{id, "emqx"},
{description, "EMQ X"},
{vsn, "4.3.0"}, % strict semver, bump manually!
{vsn, "4.3.1"}, % strict semver, bump manually!
{modules, []},
{registered, []},
{applications, [kernel,stdlib,gproc,gen_rpc,esockd,cowboy,sasl,os_mon]},

View File

@ -1,9 +1,14 @@
%% -*-: erlang -*-
{VSN,
[
[ {"4.3.0",
[ {load_module, emqx_logger_jsonfmt, brutal_purge, soft_purge, []}
]},
{<<".*">>, []}
],
[
{"4.3.0",
[ {load_module, emqx_logger_jsonfmt, brutal_purge, soft_purge, []}
]},
{<<".*">>, []}
]
}.

View File

@ -48,7 +48,7 @@
-spec format(logger:log_event(), config()) -> iodata().
format(#{level := Level, msg := Msg, meta := Meta}, Config0) when is_map(Config0) ->
Config = add_default_config(Config0),
format(Msg, Meta#{level => Level}, Config).
[format(Msg, Meta#{level => Level}, Config) , "\n"].
format(Msg, Meta, Config) ->
Data0 =