Logs Database is very Large

Re: Logs Database is very Large

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

It sounds normal. It removes records in chunks for five minutes only to avoid impacting the site's performance.

If you've changed Log Table Cleanup's schedule to run every ten minutes you would be better off manually deleting the records with an SQL statement instead. This is described in the link in this previous reply, for example (MySQL/MariaDB):

DELETE FROM mdl_logstore_standard_log WHERE timecreated < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 60 DAY));

Back up the database before making changes like this. This statement may take some time to complete and adversely affect site performance while it's running.

If you're having trouble doing this, let us know which database software you are using (MySQL, MariaDB, PostgreSQL or SQL Server).