logger_json v4.0.0 LoggerJSON.Formatter behaviour

Behaviour that should be implemented by log formatters.

Example implementations can be found in LoggerJSON.Formatters.GoogleCloudLogger and LoggerJSON.Formatters.BasicLogger.

Link to this section Summary

Callbacks

Format event callback. Returned map will be encoded to JSON.

Link to this section Callbacks

Link to this callback

format_event(level, msg, ts, md, state)

format_event(
  level :: Logger.level(),
  msg :: Logger.message(),
  ts :: Logger.Formatter.time(),
  md :: [atom()] | :all,
  state :: Map.t()
) :: Map.t() | iodata() | Jason.Fragment.t()

Format event callback. Returned map will be encoded to JSON.