HawkEx.Audit.Log (hawk_ex v0.1.0)

Copy Markdown View Source

Ecto schema for an append-only audit log entry.

Logs can represent user actions, system actions, or HawkEx lifecycle events. actor_* fields describe who performed the action. resource_* fields describe what the action targeted. metadata stores structured event data.

Audit records are intended to be append-only. Prefer inserting new events over updating or deleting existing records.

Summary

Functions

Builds a changeset for an audit log entry.

Functions

changeset(log, attrs)

Builds a changeset for an audit log entry.

Only action is required. Actor, resource, and metadata fields are optional so system events and partial external events can still be recorded.