Skip to content

[6.x] Add activity logging foundation - #19496

Draft
riasvdv wants to merge 9 commits into
6.xfrom
feature/activity-logs-base
Draft

[6.x] Add activity logging foundation#19496
riasvdv wants to merge 9 commits into
6.xfrom
feature/activity-logs-base

Conversation

@riasvdv

@riasvdv riasvdv commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Initial backend implementation of activity logging.

Activity event types require implementing a ActivityEventTypeInterface interface. This allows for plugins to add additional event types with us owning how they are rendered and stored.

This PR also adds an initial set of events logged for the most common Element events we'd be interested in:

  • Creating, updating, duplicating, moving, trashing, restoring, merging, and deleting elements
  • Changing element statuses and site assignments
  • Creating, saving, applying, and discarding drafts
  • Restoring revisions
  • Replacing asset files
  • Changing an element’s position within a structure

Activity history has a configurable retention period, with expired events removed during garbage collection.

ActivityActor, ActvitySubject and ActivitySource and the event's information are stored in snapshots on the activity row's payload. This is to ensure we can always display the activity, regardless of an actor, subject or the event itself no longer being available.

changes are stored in a list of ActivityChange DTOs, with old and new values, so rendering them will be straightforward and gives a structured and type-safe way for plugin developers to define what has changed.

An event type can also own how it's displayed by overriding or implementing the format(ActivityEvent $event) method.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

📚 Storybook previews

@craftcms/uiopen Storybook

Changed components:

resources/jsopen Storybook

No changed components detected in this Storybook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant