Audit Logs

Overview

Audit logs give you a revision history for your feeds data. When enabled, Stream records a revision every time an activity or a comment is created, edited, deleted, or restored. Each revision captures who made the change, what changed, and a snapshot of the object as it was before the change, so you have a complete, chronological trail of how your content evolved.

You enable audit logs and browse revision history from the Stream Dashboard.

What gets tracked

Audit logs currently track two object types: activities and comments.

For each of those, the following actions produce a revision:

ActionWhen it's recorded
createThe object is first created. There is no previous state, so no snapshot is stored.
editThe object is updated in place. The revision records the fields that changed and a snapshot of the object before the edit. Empty edits are skipped.
deleteThe object is soft-deleted. The revision stores a snapshot of the object before deletion.
restoreA soft-deleted object is restored.

Hard deletes are not recorded as a revision. When an object is hard-deleted, all of its existing revisions are permanently removed along with it.

Actor types

Every revision records who performed the change:

Actor typeDescription
userA change made by an end user through a client-side (token-authenticated) request. The user_id identifies that user.
adminA change made server-side with your API key and secret. The user_id is empty, because the acting party is your backend.
systemA change made automatically by Stream, such as background enrichment.

What each revision records

FieldDescription
object_idThe ID of the activity or comment the revision belongs to.
object_typeEither activity or comment.
action_typecreate, edit, delete, or restore.
actor_typeuser, admin, or system.
user_idThe user who made the change. Empty for admin and system actors.
changed_fieldsThe list of fields that changed. Present on edit revisions.
previous_obj_serializedA snapshot of the object as it was before this change. Absent on create revisions.
created_atWhen the revision was recorded.

Enabling audit logs

Audit logs are off by default and are enabled per app from the Stream Dashboard:

  1. Open the Stream Dashboard and select your app.
  2. Open the Feeds section and, under Logs, select Audit.
  3. Turn on the Audit Logs toggle.

While audit logs are disabled, no revisions are recorded and revision history is not available. Turning the toggle back off stops new revisions from being recorded; revisions already captured remain until they age out of the retention window.

Retention

Revisions are retained for a fixed window (30 days by default). Revisions older than the retention window are automatically deleted.

The retention window is configured by Stream and is not customer-editable. To change how long revisions are kept, contact support.

Viewing revisions

Under Feeds > Audit, the Revision History table lists revisions newest first, with a column for each of the following:

  • Date: when the revision was recorded
  • Action: create, edit, delete, or restore
  • Object Type: activity or comment
  • Object ID: the ID of the changed object
  • User ID: the user who made the change (empty for admin and system actors)
  • Changed Fields: the fields that changed on an edit

Use Filter to narrow the table down by object, action, user, or time range.