Joomla debug log

Just starting to use Joomla over Seagull and finding that I miss the debug log. In fact debugging in general seems a bit of a pain. I keep getting 500 server errors for no reason I can work out.

Here’s what I am doing now to simulate the SGL::logMessage() function.

In each file …

jimport('joomla.error.log');

In each class I create …

private $log = NULL;

function __construct($config = array()){       
    parent::__construct($config);
    $options = array('format' => "{DATE} {TIME} {FUNCTION}: {COMMENT}");
    $this->log = &JLog::getInstance('debug.log.hqevent.log',$options);       
    $this->log->addEntry(array('function' => __CLASS__ . '.' . __FUNCTION__, 'comment' => ""));   
}

Then at the top of each function within each class ..

$this->log->addEntry(array('function' => __CLASS__ . '.' . __FUNCTION__, 'comment' => ""));

And I do want to add a comment, then add something in the comment value, e.g.

$this->log->addEntry(array('function' => __CLASS__ . '.' . __FUNCTION__, 'comment' => "alias = [$alias]"));

 

 

 

This entry was posted in Online Business, Websites. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>