log()
Overview
public void function log(
required string userId
, required string action
, required string type
, string recordId = ""
, any detail
)
Inserts a log entry into the system's audit log. You are most likely to want to use either $audit()
or event.audit()
to proxy to this method (see Using the audit trail system for more details).
Arguments
Name | Type | Required | Description |
---|---|---|---|
userId | string | Yes | ID of the admin user who performed the action |
action | string | Yes | Key of the action performed, e.g. datamanager_edit_record |
type | string | Yes | Type of action performed, used for grouping audit logs, e.g. datamanager |
recordId | string | No (default="") | ID of the entity that was acted upon. For example, the ID of a record that was edited |
detail | any | No | A struct containing data that will be useful when rendering the audit log entry. For example, a list of fields that were changed in an edit process |