Logging API: Difference between revisions
From MoodleDocs
Created page with "The Logging API allows you to add new entries to the Moodle log and define how they get displayed in reports. (Ankit, please describe how the db/log.php files work too)" |
mNo edit summary |
||
| Line 1: | Line 1: | ||
==Overview== | |||
==File locations== | |||
The Log API is all in lib/datalib.php and is automatically included for you during the page setup. | |||
==Functions and Examples== | |||
===Functions=== | |||
function add_to_log($courseid, $module, $action, $url='', $info='', $cm=0, $user=0) | |||
function user_accesstime_log($courseid=0) | |||
get_logs($select, array $params=null, $order='l.time DESC', $limitfrom='', $limitnum='', &$totalcount) | |||
function get_logs_usercourse($userid, $courseid, $coursestart) | |||
function get_logs_userday($userid, $courseid, $daystart) | |||
===Examples=== | |||
==Mod/*/db/log.php Files== | |||
===Example=== | |||
==See Also== | |||
[https://docs.moodle.org/22/en/Logs Logs Reports] | |||
The Logging API allows you to add new entries to the Moodle log and define how they get displayed in reports. | The Logging API allows you to add new entries to the Moodle log and define how they get displayed in reports. | ||
(Ankit, please describe how the db/log.php files work too) | (Ankit, please describe how the db/log.php files work too) | ||
Revision as of 05:01, 12 January 2012
Overview
File locations
The Log API is all in lib/datalib.php and is automatically included for you during the page setup.
Functions and Examples
Functions
function add_to_log($courseid, $module, $action, $url=, $info=, $cm=0, $user=0) function user_accesstime_log($courseid=0) get_logs($select, array $params=null, $order='l.time DESC', $limitfrom=, $limitnum=, &$totalcount) function get_logs_usercourse($userid, $courseid, $coursestart) function get_logs_userday($userid, $courseid, $daystart)
Examples
Mod/*/db/log.php Files
Example
See Also
The Logging API allows you to add new entries to the Moodle log and define how they get displayed in reports.
(Ankit, please describe how the db/log.php files work too)