Developer Guide / Log Archival

Log Archival

Site-specific, configurable archival of scheduler, email and integration logs to CSV stored in Assets.

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.

EndpointPurpose
GET/POST/PUT/DELETE /api/settings/archive-policiesManage retention policies (site-scoped)
GET /api/settings/archive-policies/resolveEffective {enabled, retentionDays} for a log type & site
POST /api/settings/archive-policies/runTrigger 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.

i
Everything is per site: retention is resolved per site, each site's CSV is written to its own /archive folder, and integration-log rows are stamped with the site of the invoked component.