LoggerJSON.Redactor behaviour (logger_json v7.0.0)

View Source

This module provides a behaviour which allows to redact sensitive information from logs.

Note: redactor will not be applied on Jason.Fragment structs if the encoder is Jason. For more information about encoding and redacting see LoggerJSON.Formatter.RedactorEncoder.encode/2.

Summary

Callbacks

Creates a new redactor.

Takes a key and a value and returns a redacted value.

Callbacks

new(opts)

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

Creates a new redactor.

redact(key, value, opts)

@callback redact(key :: String.t(), value :: term(), opts :: term()) :: term()

Takes a key and a value and returns a redacted value.

This callback will be applied on key-value pairs, like elements of structs, maps or keyword lists.