mirror of
https://gitee.com/dgiiot/dgiot.git
synced 2024-11-29 18:57:41 +08:00
change to json log
This commit is contained in:
parent
ac004c395a
commit
367c081eaf
@ -44,7 +44,7 @@
|
||||
-define(LOG(Level, Format, Args),
|
||||
begin
|
||||
(logger:log(Level,#{},#{report_cb => fun(_) ->
|
||||
{'$logger_header'() ++ "[~p:~p ~p] [~s:~p] " ++ (Format), ([?MODULE, ?FUNCTION_NAME, ?LINE, node(),self()] ++ Args)} end,
|
||||
{'$logger_header'() ++ (Format), ( Args)} end,
|
||||
mfa => {?MODULE, ?FUNCTION_NAME, ?FUNCTION_ARITY},
|
||||
line => ?LINE}))
|
||||
end).
|
||||
|
@ -18,6 +18,7 @@
|
||||
-module(dgiot_datetime).
|
||||
-author("johnliu").
|
||||
-include_lib("dgiot/include/logger.hrl").
|
||||
-logger_header("[dgiot]").
|
||||
|
||||
-export([
|
||||
start_time/0,
|
||||
|
@ -17,6 +17,7 @@
|
||||
-module(dgiot_license).
|
||||
-author("johnliu").
|
||||
-include_lib("dgiot/include/logger.hrl").
|
||||
-logger_header("[dgiot]").
|
||||
|
||||
-export([init/1
|
||||
, description/0
|
||||
|
@ -448,7 +448,7 @@ log.file = emqx.log
|
||||
|
||||
## Log formatter
|
||||
## Value: text | json
|
||||
#log.formatter = text
|
||||
log.formatter = json
|
||||
|
||||
## Log to single line
|
||||
## Value: Boolean
|
||||
|
@ -502,7 +502,7 @@ end}.
|
||||
|
||||
%% @doc format logs as JSON objects
|
||||
{mapping, "log.formatter", "kernel.logger", [
|
||||
{default, text},
|
||||
{default, json},
|
||||
{datatype, {enum, [text, json]}}
|
||||
]}.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user