DMSI Webhooks automatically prunes old log entries on a daily schedule to keep the database size manageable.
Default Retention #
| Log Type | Retention |
|---|---|
| Standard delivery logs | 30 days (configurable) |
Debug logs (is_debug = 1) | 24 hours |
Rotation secrets (signing_secret_old) | 24 hours after rotation |
Configuring Retention #
- Go to DDLS > Webhooks > Settings
- Under Log Retention, set the number of days to keep log entries
- Click Save Settings
The minimum value is 1 day. There is no enforced maximum.
Cleanup Cron #
The daily cleanup runs via WP-Cron hook dmsi_webhooks_daily_cleanup. It:
- Deletes log entries created more than
log_retention_daysdays ago - Deletes
is_debug = 1entries older than 24 hours - Clears
signing_secret_oldfor endpoints rotated more than 24 hours ago - Stores a cleanup report in
dmsi_webhooks_cleanup_report(WordPress option)
Cleanup Report #
The last cleanup report is stored as a WordPress option and can be retrieved programmatically:
$report = get_option('dmsi_webhooks_cleanup_report');
// $report contains: deleted_count, debug_deleted, rotations_cleared, run_time
Impact on Failure Digests #
The daily failure digest email (dmsi_webhooks_daily_digest) only includes permanent failures from the past 24 hours. Logs older than the retention period are not reported in digests.
Manual Cleanup #
Logs can also be deleted manually from the DDLS > Webhooks > Logs admin page by filtering and bulk deleting entries.
Related Topics #
- Delivery Logs Overview
- Settings Reference
- Failure Notifications
