Task logs

Task logs

par Andrew Lyons,
Nombre de réponses : 4
Avatar Core developers Avatar Moodle HQ Avatar Particularly helpful Moodlers Avatar Peer reviewers Avatar Plugin developers Avatar Testers

Hi folks,

One of the areas I've seen people mention particular pains over (many) years I've worked with Moodle is that of capturing and reviewing the logs from Cron/Tasks. At the moment the recommended way of doing this is by capturing all cron output at time of run (typically by piping output to a log file) but I feel that this has many pitfalls.

To that ends I've bee working on MDL-49399 to capture as much of the output from Moodle tasks as possible, and store it for later viewing within the UI. These changes capture almost all output shown in the console with a couple of exceptions to this (When the PHP interpreter segfaults, and one particular method out of output rarely used). It captures when the task fails, dies, or errors too.

This change also adds a UI to view and search the logs, and links are included from the scheduled task page.

I'd appreciate any feedback, thoughts, comments, etc. that you may have. If this is a feature that you feel would be useful you can also vote on the issue.

I've placed some screenshots at https://imgur.com/a/drge11y and in the issue for reference.

Thanks,

Andrew


Moyenne des évaluations Useful (5)
En réponse à Andrew Lyons

Re: Task logs

par Séverin TERRIER,
Avatar Documentation writers Avatar Particularly helpful Moodlers Avatar Testers Avatar Translators

Hi Andrew,

I think it will be a good improvment sourire

For the moment, i keep track of different Moodle automated tasks, like cron executions, CAS synchronisation, Automated Backups and Course enrolments (via DB) in several different log files per type and date of execution.

I've then created a bash script to verify these files daily (or weekly), and send an email to have an easy way to know what isn't good on my Moodle installation. It also allows my (Admin) collegues, less technical, with no direct access to the server to be warned when something is wrong (even if i'm away).

This improvment seems promising. Hope you can also provide a way to directly inform admins if something is wrong ; perhaps with a dedicated task, or an email...

Séverin

En réponse à Séverin TERRIER

Re: Task logs

par Tim Hunt,
Avatar Core developers Avatar Documentation writers Avatar Particularly helpful Moodlers Avatar Peer reviewers Avatar Plugin developers
We have long had a quick and dirty hack to do this at the Open University. Really good to finally see a proper implementation going into Moodle core.
En réponse à Andrew Lyons

Re: Task logs

par Rex Lorenzo,

This week be incredibly useful.


Another useful bit that you can add is an option to have the next time the task is run to enable debugging. You can specify debugging if you run the task via command line but would be nice to surface that in these logs to aid in debugging task failures

Moyenne des évaluations Useful (1)