Repository navigation
#147 - Purge the log records and the log files older than a configured retention - #148
Merged
Merged
Conversation
…d retention New cleverage:ui-process:purge-logs command, logs.database_max_days and logs.file_max_days bundle configuration, overridable by the logs option of each process. The process executions are kept. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #147: log retention, as proposed in #147 (comment) (no CSV export: the log file of the execution is the archive).
Configuration
logs.database_max_daysandlogs.file_max_days(int≥ 1, defaultnull: kept, no behaviour change).logskey of its options (next touiandnotification); a missing ornullkey is inherited from the bundle configuration.ProcessConfigurationsManager::getLogsOptions().cleverage:ui-process:purge-logs [--dry-run]log_recordrows created more thandatabase_max_daysdays ago (DBAL, by batches of 1000: select ids,DELETE ... WHERE id IN (...)).%kernel.logs_dir%/<code>/and deletes the files last modified more thanfile_max_daysdays ago. Only the files written by the bundle (<uuid>.log) are deleted; a code that cannot be a directory name of the log directory (..,/) is skipped.process_executionand those of the defined processes; the executions of a process no longer defined use the bundle retention.process_executionis never modified nor deleted: the UI already hides "Download log file" (file missing) and "Show logs stored in database" (no log left).--dry-runcounts without deleting. Output: one row per process with a retention (retentions, records / files deleted) and totals.VACUUM FULL,OPTIMIZE TABLE,VACUUM) is not run by the command: it locks the table and would block the running processes. Documented, to run once after the first purge during a maintenance window.Documentation
Executions & logs reference (new "Log retention" section, with "Database space"), bundle configuration, process UI options (
logskey), console commands, index, troubleshooting ("The log_record table keeps growing"); CHANGELOG (Latest).Tests
getLogsOptions()(defaults, configured, invalid values, unknown process).PurgeLogsCommandTeston the SQLite test database: service, nothing to purge, bundle and process retentions, process no longer defined, file not written by the bundle kept,--dry-run, database retention only, process retention only, 2001 records deleted by batches, executions kept.Requirements
Breaking changes
None: new configuration with
nulldefaults (nothing purged), new process option, new command. Minor.🤖 Generated with Claude Code