oo

Auditing Object Events

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

Subscription

To access the Audit application, open the Global Menu (Global Menu) → Control Panel → click Audit.

Click Audit in the Control Panel to view events related to object definitions.

Events appear in a table:

Column Description
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., ObjectDefinition#44168).
Resource Action Action performed (ADD, UPDATE, or DELETE).
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.

Click an event field to view more details.

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.

important

Using REST APIs to view an entry’s history requires both the View and 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,

  1. Open the Global Menu (Global Menu), go to the Control Panel tab, and click Objects.

  2. Begin editing the desired object definition.

  3. In the Details tab, toggle Enable Entry History.

    Enable entry history.

  4. Click Save.

While enabled, Liferay keeps a history of entry events that you can view in the Audit application or via REST API calls.

Feature: