secure_log_formatter v1.2.0 SecureLogFormatter

Documentation for SecureLogFormatter.

Link to this section Summary

Functions

Secure formatting for Elixir Logger

Securely inspect a value

Sanitize the input value

Link to this section Functions

Link to this function default_fields()
Link to this function format(level, msg, ts, md)

Secure formatting for Elixir Logger

Examples

iex> SecureLogFormatter.format(:info, "CC 4111111111111111", nil, [])
["\n", :time, " ", "", "[", "info", "] ", " ", "CC [REDACTED]", "\n"]
Link to this function inspect(message)

Securely inspect a value.

Examples

iex> SecureLogFormatter.inspect(%{user: "username", password: "abc123"})
~s(%{password: "[REDACTED]", user: "username"})

iex> SecureLogFormatter.inspect([access_token: "secret"])
~s([access_token: "[REDACTED]"])

iex> SecureLogFormatter.inspect("Customer CC 4111111111111111")
~s("Customer CC [REDACTED]")

Sanitize the input value.

Examples

iex> SecureLogFormatter.sanitize(%{user: "username", password: "abc123"})
%{password: "[REDACTED]", user: "username"}

iex> SecureLogFormatter.sanitize([access_token: "secret"])
[access_token: "[REDACTED]"]

iex> SecureLogFormatter.sanitize("Customer CC 4111111111111111")
"Customer CC [REDACTED]"
Link to this function sanitize_list(improper_tail, acc)