Add new logging API support for requiredtime setting

The 'required time in course' setting in certificate currently relies on the old mdl_log table. In M2.7+, the new logging api needs to be used instead. This change uses the new api to correctly read from the active logstore.