High-volume log tables — scheduler job logs, email send logs and integration (SOAP) logs — can be archived to CSV after a configurable retention period and then pruned. Archives are stored as ordinary, site-scoped assets so administrators can download or delete them through the asset library.
Retention policy
The settings service owns an archive_policy table keyed by (log_type, site_id) with retention_days and an enabled flag. Log types are SCHEDULER_JOB_LOG, EMAIL_LOG and INTEGRATION_LOG. Resolution is site-first with a global (site_id IS NULL) fallback.
| Endpoint | Purpose |
|---|---|
GET/POST/PUT/DELETE /api/settings/archive-policies | Manage retention policies (site-scoped) |
GET /api/settings/archive-policies/resolve | Effective {enabled, retentionDays} for a log type & site |
POST /api/settings/archive-policies/run | Trigger an archive run on demand (admin) |
The archivers
Each owning service runs a daily (and on-demand) archiver: settings for scheduler logs, the email service for send logs, and the SOAP tracker for integration logs. For each site with rows older than the cutoff it builds a CSV, uploads it to the asset service, and only deletes the rows after a confirmed upload — so a storage hiccup never loses data.
Where archives go
The asset service exposes an internal sink (POST /api/assets/internal/archive) that stores the CSV as a published asset under the site's /archive folder. From there the normal asset list, download and delete actions apply — no separate UI is needed. Administrators configure retention on the Governance → Archiving screen.
/archive folder, and integration-log rows are stamped with the site of the invoked component.