Standard Log Huge

Standard Log Huge

by Dave Baldwin -
Number of replies: 4

We upgraded to moodle 3.1 a couple months ago and recently discovered that the mdl_logstore_standard_log has over 250,000,000 records in it!

I did a little digging to discover the following:

Origin = cli

target = user

action = updated

component = core

eventname = \core\event\user_updated

I think that this command is running out of control (paraphrased)

INSERT INTO mdl_tmp_extuser username mnethostid VALUES...

but I am not very good with mysql so not sure how to determine for sure if that is the culprit.

Can anyone tell me how to get this under control?

Also, I am trying to delete from mdl_logstore_standard_log where origin='cli' and target='user' and action = 'updated'; but I don't think it is actually doing anything.  I let it run for a few hours last week with no result.

I did read that I might be able to truncate the whole table with more success but I did not get a chance yet to read up on what kind of activity reports might be impacted by that.

Moodle is running on Centos6 with mysql 5.6.26

We have not updated to 3.2 because many of our courses are using an outdated certificate plugin and our course managers are working on migrating them to badges first.

Any help appreciated.

Dave Baldwin

Average of ratings: -
In reply to Dave Baldwin

Re: Standard Log Huge

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It's quite possible for the logstore to get huge. Unless you set the lifetime on the logs it never gets deleted. I doubt there's anything wrong.

In reply to Howard Miller

Re: Standard Log Huge

by Dave Baldwin -

I set the log retention to 365 days already.

The growth started after the upgrade a few months ago and within thirty days jumped from the hundreds of thousands to the hundreds of millions.

We only have about 1200 total users and maybe only about 800 active.

The database is growing multiple gb per day.

It seems a little excessive.

In reply to Dave Baldwin

Re: Standard Log Huge

by James Snell -

I have a similar situation. A Moodle server of about 2000 users. Cli-driven AD sync via cron every few minutes. Each user's profile is "updated" and thus a line goes in the log. My logs live for 6 months, which is shorter than I'd like. But all this traffic means my logs table is 86GB! It'd love to disable logging of these cli messages.

In reply to James Snell

Re: Standard Log Huge

by Dave Baldwin -

I ended up having to truncate the log and setting a reminder to check it monthly.

Still have not been able to figure out how to get it to stop flooding the log with useless info.