Found the problem. It was just me being stupid (as always).
We are connecting to Moodle from SQL SERVER using a linked server. I was using the linked server for the old Moodle server, which is why the logs stopped after a certain date. Changed it to the new one in ODBC data source admin and it works now.