AuditTrail.Config (audit_trail v0.1.2)

Copy Markdown

Summary

Functions

Path to the DETS file when dead_letter_persistent?/0 is true. Defaults to a file in the current working directory — override for anything beyond local dev.

When true, AuditTrail.DeadLetter persists its queue to disk (via :dets) instead of plain in-memory ETS, so entries queued when Loki is down survive a node restart/deploy instead of being lost. Off by default — DETS is disk-backed and slower than ETS, so this is opt-in rather than changing default behavior for existing users

Field names whose values get redacted before a log payload ships, regardless of which entry point produced it (ControllerAudit, emit/2, monitor/4's original_record:/params: diffing, schema-level Diff). Matched case-insensitively against both atom and string map keys.

Returns the configured storage adapter.

Functions

actor_extractor()

app_name()

batch_size()

crash_reporting_enabled?()

crash_routing()

dead_letter_path()

Path to the DETS file when dead_letter_persistent?/0 is true. Defaults to a file in the current working directory — override for anything beyond local dev.

dead_letter_persistent?()

When true, AuditTrail.DeadLetter persists its queue to disk (via :dets) instead of plain in-memory ETS, so entries queued when Loki is down survive a node restart/deploy instead of being lost. Off by default — DETS is disk-backed and slower than ETS, so this is opt-in rather than changing default behavior for existing users:

config :audit_trail,
  dead_letter_persistent: true,
  dead_letter_path:       "/var/lib/my_app/audit_trail_dead_letter.dets"

The directory in dead_letter_path: must already exist and be writable — this is not created automatically.

dead_letter_redrive_interval()

dedup_max_entries()

dedup_window_ms()

enabled?()

flush_interval()

from_email()

loki_push_url()

loki_read_url()

mailer_adapter()

max_buffer()

max_dead_letter()

partition_count()

sensitive_fields()

Field names whose values get redacted before a log payload ships, regardless of which entry point produced it (ControllerAudit, emit/2, monitor/4's original_record:/params: diffing, schema-level Diff). Matched case-insensitively against both atom and string map keys.

Override entirely (this replaces the defaults, it doesn't add to them — include what you still want redacted):

config :audit_trail, sensitive_fields: ~w(password token my_app_secret)

shipper_retries()

shipper_timeout()

smtp_config()

storage_adapter()

Returns the configured storage adapter.

Can be:

Defaults to AuditTrail.Adapters.Loki.

swoosh_mailer()