Log an entry into Joomla Log

Written by khawaib

Topics: Joomla! 1.5

Joomla’s JLog class enables to create log files with useful debug info and other log messages. Following is the PHP code that can be used to log messages.

jimport( 'joomla.error.log' );
$log = JLog::getInstance('log_file.php'); // get an instance of JLog
// create entry array
$entry = array('LEVEL' => '1', 'STATUS' => "SOME ERROR:", 'COMMENT' => $shortUrl->getError() );
// add entry to the log

1 Comment Comments For This Post I'd Love to Hear Yours!

  1. Starly says:

    Gosh, I wish I would have had that infromtoain earlier!

Leave a Comment Here's Your Chance to Be Heard!

You must be logged in to post a comment.