ExJsonLogger (ex_json_logger v1.3.0) View Source
A Logger formatter that converts logs to single line JSON.
Logging additional information
Use Logger's metadata to add additional data to the log output.
This can be done through Logger.metadata/1
or by passing Keywords to standard Logger calls in the optional second parameter.
Logger filters metadata so any additional keys will need to be whitelisted in the backend's configuration.
Usage
config :logger, :console,
format: {ExJsonLogger, :format},
metadata: [
:request_id,
:additional_key
]
Currently tested with the :console
logger backend.
Link to this section Summary
Functions
Function referenced in the :format
config.
Link to this section Functions
Specs
format(Logger.level(), Logger.message(), Logger.Formatter.time(), Keyword.t()) :: String.t()
Function referenced in the :format
config.