0
votes

Does Joomla have a general purpose API for logging debug information to a file, or to the database, so that extension writers can capture debug info from a live site?

Enabling debug output and logging to screen is not an option. It's a live site.

Something like Drupal's watchdog would be nice.

1
There is a JLog class and you can find more details here - docs.joomla.org/Using_JLog joomla.stackexchange.com/questions/7286/… - Irfan

1 Answers

0
votes

I'm sorry for the short answer :)

This page might help: https://docs.joomla.org/Using_JLog

It shows how to configure the log output and how to use logging in your own code.


EDIT, in case the link dies: Enable "Log Everything" under the properties of the System - Debug plugin. To create log records:

JLog::add("Hello world", JLog::INFO);

If within a namespace, qualify JLog:

\JLog::add("Hello world", \JLog::INFO);

There's no built-in log reading UI, just look at administrator/logs/everything.php.