> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alforse.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Audit log

> A per-company change history for key business entities. What gets recorded, how to view and filter it, and how old entries are archived.

The audit log records creates, updates, and deletes for supported business entities. Each entry identifies the actor and changed fields. Logging is isolated by company and is **off by default**. Enable it under **Settings → Audit Logs**. Alforse records only changes made after enablement.

NOTE

The log groups changes by business entity. For example, changing an item's cost creates an **Item** entry rather than an entry for the underlying `itemCost` row.

## Turning it on

The **Audit Logging** card contains one toggle. Enabling it creates company-specific storage, sets `auditLogEnabled`, and subscribes supported tables to the change pipeline. The card shows the current state:

* Enabled: *"Audit logging is enabled — All changes to auditable entities are being recorded."*
* Disabled: *"Audit logging is disabled — Enable to start tracking changes to your data."*

Disabling logging stops new entries but preserves existing history. Re-enabling resumes logging without filling the disabled interval.

Only users who can **update settings** can flip the toggle. Viewing the log needs the **view settings** permission. See [permissions and access](/docs/reference/permissions.md) for how the settings module maps to employee types.

## What gets logged

Alforse tracks a fixed set of entities. Anything not on this list is not audited.

| Entity | Entity |
| - | - |
| Customer | Supplier |
| Item | Item Shelf Life |
| Sales Order | Purchase Order |
| Sales Invoice | Purchase Invoice |
| Quote | Supplier Quote |
| Job | Employee |
| Non-Conformance | Change Notice |
| Gauge | Shipment |
| Receipt | Warehouse Transfer |
| Stock Transfer | Inventory Count |
| Work Center | Maintenance Schedule |
| Maintenance Dispatch | Pricing Rule |
| Price Override | Price Override Break |
| Fixed Asset | Accounting Period |
| Rental Agreement | Journal Entry |
| Payment | Memo |
| Reimbursement | Picking List |
| Depreciation Run | Revenue Recognition Run |
| ITAR Certification | Invite |

Each entry records the **operation** (`INSERT`, `UPDATE`, or `DELETE`), **actor**, field-level diff, request **metadata** (IP address, user agent, and origin), and **timestamp**. System and service-role changes show *System* as the actor. Diffs exclude bookkeeping fields such as `updatedAt`, `updatedBy`, and internal embeddings.

## Viewing and filtering

Two views surface the same data at different scopes.

**Per-entity history.** On most entity detail pages (a customer, sales order, job, shipment, and more) a **History** action opens a drawer showing just that record's timeline. Each change lists the operation, the actor, when it happened, and an expandable list of the fields that moved. If audit logging is off, the drawer says *"Audit logging is not enabled"* with a shortcut to enable it in settings (or a note to contact your administrator if you can't).

**The global log.** From the Audit Logs settings page, **View All** opens the full-screen **All Audit Logs** table. It is searchable and paginated, with filters for:

* **Entity** — narrow to one entity type (Sales Order, Item, and so on).
* **Operation** — Created, Updated, or Deleted.
* **Changed By** — the user (actor) responsible.

The table columns are **Entity**, **Operation**, **Changed By**, **Changes**, and **When**. Operations render as colored badges — Created (green), Updated (blue), Deleted (red) — and each row expands to show the field-level diff. The Entity value links straight to the record it describes.

## Retention and archives

The live log retains **30 days** of activity. A nightly job moves older entries into a compressed archive, records its date range, row count, and size, and removes those entries from the live table.

Archived periods appear under **Archived Logs** on the settings page, each with a **Download** button that generates a short-lived signed link to the compressed export. When no archives exist yet, the card explains that logs older than 30 days will be archived and made available for download there.

NOTE

Enabling audit logging affects data written from that point on. It does not retroactively reconstruct changes that happened before it was turned on.

## Related

**Company settings**

The company record and its feature toggles, including audit logging.

[Open](/docs/reference/company-settings.md)

**Permissions and access**

How the settings permission gates who can view and manage the log.

[Open](/docs/reference/permissions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.