Commit

6b96267

πŸ’‘ Moodle Tip: Keep logs in the database from a fixed date! Moodle's Standard log only offers a fixed set of retention periods, up to 1000 days. But what if you need to keep every log since a specific date, for example for an audit or a contract requirement? Add this to config.php using $CFG->forced_plugin_settings. It works out how many days have passed since your chosen date, and Moodle's "Log table cleanup" scheduled task then removes only the logs older than that date. A few things to know: πŸ”Ή Forced settings live only in memory. The value in mdl_config_plugins stays unchanged, and Moodle ignores it. πŸ”Ή The admin page shows "Invalid current value" because the number isn't one of the dropdown options. The cleanup still works. πŸ”Ή Nothing is deleted until cron runs \logstore_standard\task\cleanup_task. Small trick, big difference for data retention policies.

commit 6b96267