Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 38 and 311] [Versions 39 and 311]

Database logger for task logging.

Copyright: 2018 Andrew Nicols <andrew@nicols.co.uk>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 173 lines (6 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

database_logger:: (6 methods):
  is_configured()
  store_log_for_task()
  has_log_report()
  get_url_for_task_class()
  cleanup()
  delete_task_logs()


Class: database_logger  - X-Ref

Database logger for task logging.

is_configured()   X-Ref
Whether the task is configured and ready to log.

return: bool

store_log_for_task(task_base $task, string $logpath, bool $failed,int $dbreads, int $dbwrites, float $timestart, float $timeend)   X-Ref
Store the log for the specified task.

param: task_base   $task The task that the log belongs to.
param: string      $logpath The path to the log on disk
param: bool        $failed Whether the task failed
param: int         $dbreads The number of DB reads
param: int         $dbwrites The number of DB writes
param: float       $timestart The start time of the task
param: float       $timeend The end time of the task

has_log_report()   X-Ref
Whether this task logger has a report available.

return: bool

get_url_for_task_class(string $classname)   X-Ref
Get any URL available for viewing relevant task log reports.

param: string      $classname The task class to fetch for
return: \moodle_url

cleanup()   X-Ref
Cleanup old task logs.


delete_task_logs(array $logids)   X-Ref
Delete task logs for the specified logs.

param: array   $logids