Extension for resources that should log events.
use Ash.Resource,
extensions: [AshEventLog.Resource]
event_log do
event_log MyApp.Events.Event
ignore_actions [:background_recalculate]
endUse only_actions to opt in to a specific allowlist instead:
event_log do
event_log MyApp.Events.Event
only_actions [:create, :update]
endignore_actions and only_actions are mutually exclusive.
event_log
Options
| Name | Type | Default | Docs |
|---|---|---|---|
event_log | atom | The event log resource module. | |
ignore_actions | list(atom) | [] | Actions to exclude from event logging. Mutually exclusive with only_actions. |
only_actions | list(atom) | If set, only these actions will be logged. Mutually exclusive with ignore_actions. |