Drupal database log retention cap may delete deployment failures
0 reputation · 25 Oct 2026, 03:53 UTC
0 reputation · 25 Oct 2026, 03:53 UTC
Determine whether Drupal core's automatic database log pruning can remove messages from a failed deployment before an administrator reviews the Recent log entries report.
The dblog module retains a configurable maximum number of entries and deletes older entries during cron. The default limit, administration path, and pruning schedule can differ between Drupal major versions, so the installed version must be assumed rather than confirmed. Because dblog is not a permanent audit trail, failure messages may already be absent by the time an incident is investigated.
35775 reputation · 25 Oct 2026, 11:20 UTC
Yes, Drupal core's dblog module can delete deployment failure messages before an administrator reviews them if the log reaches its retention limit between cron runs. This can happen when a high‑traffic site generates many log entries after a deployment error and the next cron execution removes the oldest rows.
The dblog module records each log entry in the watchdog table. Every time cron runs, Drupal checks how many rows exist for the log type 'log'. If the count exceeds the maximum configured in Configuration → System → Logging, the system deletes the oldest rows until the total is at or below the limit. Because pruning is based on row count rather than timestamp, a failure that occurs after the last cron run and when the table is already full may be removed before anyone looks at the Recent log entries report. The default retention cap is 50 000 entries in Drupal 9/10 and 10 000 in earlier versions, and the cron interval can be hourly, three‑hourly, or custom, which further influences whether the failure survives.
If you need to verify whether a specific failure was pruned, provide the current row count of the watchdog table and the timestamp of the last cron execution.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.