Activity Logs
- Code: SET-LOG
- Module: Settings
- Type: System Record
1. Overview
Activity Logs record every data change in the tenant: who did what, when, on which data, and what changed. There are two views: one combined cross-module timeline in Settings, and a dedicated panel in each feature that only shows the logs of that feature’s data.
Expected outcome: owners and auditors can trace any change without help from the technical team.
2. Problem
Without automatically recorded traces, tracking down who changed what can only rely on memory or verbal reports. As a result:
- Data errors (prices, statuses, access) are hard to trace to their cause without a change trail.
- Owners need to make sure there are no unauthorized changes to important settings.
- One action can change several records at once; related changes need to be visible together.
3. Goals & Non-goals
3.1 Goals
- The cause of a data error can be traced back to who changed it and when.
- Changes to important settings can be checked at any time without help from the technical team.
- Changes that happen within one action are visible as one sequence, not as separate fragments.
- Tracing can be narrowed down to a specific period, actor, or data type when investigating an incident.
3.2 Non-goals
- Editing or deleting logs from within the app.
- Exporting logs to external files.
- Automatic alerts when certain changes occur.
4. Business Rules
Business rules are the set of provisions and constraints that apply to Activity Logs throughout the application, on every screen and action that involves it, whoever performs it. These rules are the single source of truth: if another part of this PRD appears to differ, the rules here prevail.
- BR-01 Logs can only be appended. There is no action to edit or delete them.
- BR-02 Logs are created automatically on every data change, never created or edited manually.
- BR-03 Changes that occur within one action are grouped as one parent log along with its child logs.
- BR-04 Logs are displayed in order from newest and loaded incrementally as they are browsed.
- BR-05 Filter options follow the log data that has actually been recorded, not a fixed list.
5. Flow
5.1 Main Flowchart
- Log Timeline — All changes are shown in order from newest, each containing the actor, the data type, and the time it occurred.
- Narrow the Search — Browsing is narrowed by activity type, data type, actor, or date range. The filtered result can be shared via the page link.
- Load Next Logs — Older logs are loaded incrementally as needed.
- Change Detail — A log is opened to see its old and new values, along with other changes that occurred in the same action.
6. Document Structure
6.1 General
| Field | Type | Required | Default | Rules |
|---|---|---|---|---|
| Log Id | Text | — | Generated by the system | Log identifier |
| Log Name | Text | — | Module of the changed data | Set by the system |
| Event | Enum | — | The type of change that occurred | For example created, updated, deleted |
| Title & Message | Text | — | Composed by the system from the change | Text shown in the list |
| Actor | Ref. User | — | The user who made the change | User name, email, and photo |
| Related Data | Ref. Data | — | The data that changed | Its data type and identifier |
| Changes | Object, multiple | — | The difference before and after | List of fields with their old and new values |
| Metadata | Object | — | Recorded when the change occurs | IP address and device used |
| Time | Date & Time | — | When the change occurred | Displayed both absolute and relative |
| Child Logs | Ref. Log, multiple | — | — | Other logs within the same action, with an identical structure (BR-03) |
7. UI Structure
This section defines how Activity Logs are displayed and operated: the feed layout and filters along with their option sources. This section only governs display and interaction; content and value rules still follow Document Structure.
7.1 Feed
Not a table, but a single-column list loaded incrementally, newest at the top.
| Part | Sample Value | Component |
|---|---|---|
| Actor | Budi Santoso | Avatar, Text |
| Message | Changed the purchase price of product Cooking Oil 2L | Text |
| Log Name & Event | Product · updated | Badge |
| Time | 5 minutes ago | Text, absolute and relative |
| Changes | Purchase Price: Rp 12,000 → Rp 12,500 | Table of old value to new value, expandable |
| Child Logs | 3 related changes | Accordion, only if any |
7.2 Advance Filter
| Field | Control | Options Source | Default |
|---|---|---|---|
| Event | Multi Select | Events that have been recorded (BR-05) | Empty |
| Log Name | Multi Select | Log names that have been recorded (BR-05) | Empty |
| Actor | Multi Select | Users who have been recorded as actors (BR-05) | Empty |
| Date | Date Range Picker | — | Empty |
8. User Stories
US-01 - View all activity logs
As an owner, I want to see all data changes in the tenant in one place, so that they are easy to audit.
| ID | Acceptance criteria |
|---|---|
| AC-01.1 | The page can only be opened by users with the activity log list permission; others are redirected to unauthorized. |
| AC-01.2 | Each log shows the actor, message, log name, event, and time. |
| AC-01.3 | Logs are loaded incrementally with a load more button; the button is hidden when there is no more data. |
| AC-01.4 | Field changes are shown as a table of old value → new value; empty values are marked as having no value. |
| AC-01.5 | A log with child logs shows a “view related changes” accordion. |
| AC-01.6 | The actor has been deleted — the log must still be displayable (BR-01). |
| AC-01.7 | A change value that is an object or array — displayed in a structured way, not as raw text. |
US-02 - Filter logs
As an auditor, I want to filter logs, so that I can quickly find the change I am looking for.
| ID | Acceptance criteria |
|---|---|
| AC-02.1 | The event, log name, and actor filters are multi-select options that follow the log data that has been recorded (BR-05). |
| AC-02.2 | Date range filter: a single date or a range; sent as start_date and end_date (yyyy-MM-dd). A single date means start_date = end_date. |
| AC-02.3 | Filters are stored in the URL and restored when the page is reopened. |
| AC-02.4 | Filters can be reset to empty. |
| AC-02.5 | The URL contains invalid filters — filters revert to the empty default. |
US-03 - Per-feature logs
As an admin, I want to see logs directly from a feature page, so that I do not have to filter manually.
| ID | Acceptance criteria |
|---|---|
| AC-03.1 | The Activity Logs button on a list page shows the logs of all the feature’s data; on a detail page it shows the logs of that record only. |
| AC-03.2 | The panel uses the same display format as the global page, with event, actor, and date range filters. |
| AC-03.3 | Features without activity logs — Roles & Permissions and File Manager do not have a log panel in the UI yet. |
9. User Scenarios
| Role | Scenario |
|---|---|
| Owner | Finds out who changed a product’s purchase price last week |
| Auditor | Filters all changes made by one user within a specific date range |
| Owner | Checks role and permission changes after an incident |
| Admin | Shares a link to a filtered log result with a colleague (filters are stored in the URL) |
10. Permissions & Actions
10.1 Permission by Action
| Action | Permission | Condition |
|---|---|---|
| View Activity Logs (Global) | settings:activity-log:list:any | — |
| View Activity Logs (Per Feature) | The list or detail view permission of the related feature | Follows the page where the panel is opened |
11. Notifications
This feature does not trigger any notifications.
12. Dependencies
Related PRDs
- All audited features (Appearance, Company, Stores, Entities, Employees, Users, Purchase Order, and others).
- Users — log actors are users.