O'Reilly logo

Mastering Joomla! 1.5 Extension and Framework Development by Chuck Lanham, James Kennard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Log files

Joomla! provides the JLog class for handling log files. In order to use this class we must first import it:

jimport('joomla.error.log');

Let's start by exploring the use of JLog to handle the global error log file. The global error log file is a PHP file generally used to log failed login attempts.

To access the global error log file we obtain a reference using the JLog::getInstance() method:

$errorLog =& JLog::getInstance();

New entries are appended to the end of the log file and they are derived from associative arrays. The array keys differ depending on the log file; the global error log file uses the following keys:

  • DATE
  • TIME
  • LEVEL
  • C-IP
  • STATUS
  • COMMENT

The DATE, TIME, or C-IP keys are automatically populated. In fact we are not required to ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required