core\task\database_logger

core\task\database_logger

James Becker -
回帖数:3

Upgraded one of my sites to 4.5+. The upgrade went smoothly and the site is working as it should. However, now I am receiving this message via email:

"On Nov 25, 2024, at 1:51 PM, Cron Daemon <u12-eersuw6kchlz@c55183.sgvps.net> wrote:
Exception ignored in shutdown function \core\task\manager::fail_running_task: Class "core\task\database_logger" not found"

Any idea what is going on here?

回复James Becker

Re: core\task\database_logger

Leon Stringer -
Core developers的头像 Particularly helpful Moodlers的头像

Is debugging enabled?

Does the file lib/classes/task/database_logger.php – which contains class core\task\database_logger – exist in the site's Moodle source code folder?

How is your Moodle cron configured to run? Normally this starts with /PATH/TO/php. If you run this first part with -v at the command line (SSH) to report the version (for example, /usr/bin/php -v or /opt/cpanel/ea-php83 -v) what does it say?

回复Leon Stringer

Re: core\task\database_logger

James Becker -
Yes the file database_logger.php exists where it should.
This is the cron command that has always worked: php /home/customer/www/?????.com/public_html/admin/cli/cron.php > /dev/null
Of course, the ??'s are replaced site name.
Debugging is not enabled. I'll give that a try.
 
I just enabled debugging and it reports no errors.
回复James Becker

Re: core\task\database_logger

Ken Task -
Particularly helpful Moodlers的头像

With your cron redirecting to la-la-land, you don't really know if ALL of the task in the cron job are running without error.

Suggest creating a log file for the cron job ..

touch /var/log/moodlecron.log

change ownerships/permission on that .log to match your web service.

Then change cron job redirect to > /var/log/moodlecron.log

You can then watch that log in realtime:

tail -f /var/log/moodlecron.log

When the cron job is scheduled to run, the above screen will scroll.

And ... at any time you can view the entire log file:

cat /var/log/moodlecron.log |more

or even search it with fgrep for a term ... like 'error';

fgrep error /var/log/moodlecron.log

'SoS', Ken