- This table is used to provide the reports shown in Site administration → Reports → Logs. Some third party plugins may also use this information.
- The risk of a TRUNCATE TABLE is to your records-keeping and data retention requirements. For example if you wanted to check the logs for something that happened last week the information would be gone.
- You can set a retention period for these logs under Site administration → Plugins → Logging → Standard log and changing Keep logs for to the required value.
If you make that last change the site cron will delete older records but it won't do this in one go (it will delete as much as it can for five minutes then wait till the next run) but the table size will reduce over time.
You could delete the older records manually, the statement below should work but make a backup of the database first:
DELETE FROM mdl_logstore_standard_log WHERE timecreated < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 90 DAY));
Then you could optionally run OPTIMIZE TABLE mdl_logstore_standard_log to recover space on the filesystem (assuming innodb_file_per_table is enabled). Note that both the DELETE FROM and OPTIMIZE TABLE statements may impact the site's performance when they're running.
(Support for Moodle 3.0 ended in 2015, you should plan to upgrade your site to a supported version. Moodle 3.0.3 is seven updates behind the final update 3.0.10).