Auditing Object Definition Events
Available Liferay 7.4 U72+/GA72+
You can use Liferay’s audit framework to track events for custom object definitions and their entries. To track entry events, you must enable entry history for the object definition. While enabled, you can view an entry’s history via the Audit application or REST APIs.
Using the Audit Application
To access the Audit application, open the Global Menu () → Control Panel → click Audit.
Events appear in a table:
|User ID||Acting user’s ID.|
|User Name||Acting user’s name.|
|Resource ID||Affected resource’s ID.|
|Resource Name||Affected resource’s name, including its ID (e.g.,
|Resource Action||Action performed (
|Client IP||IP address responsible for the action.|
|Create Date||When the event record was created.|
Click an event field to view a more complete record, including specific action details. You can search and filter results using keywords and other terms.
Object entry events use the
ObjectDefinition#[ObjectID] naming pattern.
Using REST APIs
You can use the
nestedFields parameter with the
auditEvents value to return an entry’s history in GET API calls (e.g.,
http://localhost:8080/o/c/tickets/?nestedFields=auditEvents). See Using
nestedFields to Audit Entry History for a basic tutorial.
Using REST APIs to view an entry’s history requires both the
Object Entry History permissions for the entry. See Permissions Framework Integration for more information.
Enabling Entry History
By default, entry history is disabled for custom objects. For 7.4 U72+/GA72+, you can configure this setting at any time. In earlier versions, you can only configure this setting before publishing the object definition.
To enable entry history,
Open the Global Menu (), go to the Control Panel tab, and click Objects.
Begin editing the desired object definition.
In the Details tab, toggle Enable Entry History.
While enabled, Liferay keeps a history of entry events that you can view in the Audit application or via REST API calls.