Task logs

Task logs

by Andrew Lyons -
Number of replies: 4
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of 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


Average of ratings: Useful (5)
In reply to Andrew Lyons

Re: Task logs

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Hi Andrew,

I think it will be a good improvment smile

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

In reply to Séverin Terrier

Re: Task logs

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of 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.
In reply to Andrew Lyons

Re: Task logs

by 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

Average of ratings: Useful (1)
In reply to Andrew Lyons

Re: Task logs

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Just a quick note to say that MDL-49399 has now landed and cron logs will be available in the Moodle UI from Moodle 3.7.

Average of ratings: Useful (4)