LoggerJSON.Redactors.RedactKeys (logger_json v7.0.3)

View Source

A simple redactor which replace the value of the keys with "[REDACTED]".

It takes list of keys to redact as an argument, eg.:

config :logger, :default_handler,
  formatter:
    LoggerJSON.Formatters.Basic.new(
      redactors: [
        LoggerJSON.Redactors.RedactKeys.new(["password"])
      ]
    )

Keep in mind that the key will be converted to binary before sending it to the redactor.