Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 310]

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