LoggerJSON.Formatter behaviour (logger_json v7.0.0)

View Source

Summary

Callbacks

Formats a log event.

Creates a new configuration for the formatter.

Types

encoder_opts()

@type encoder_opts() :: JSON.encoder() | [Jason.encode_opt()] | term()

opts()

@type opts() :: [
  {:encoder_opts, encoder_opts()}
  | {:metadata, :all | {:all_except, [atom()]} | [atom()]}
  | {:redactors, [{module(), term()}]}
  | {atom(), term()}
]

Callbacks

format(event, opts)

@callback format(event :: :logger.log_event(), opts :: opts()) :: iodata()

Formats a log event.

new(opts)

@callback new(opts()) :: {module(), term()}

Creates a new configuration for the formatter.