Dispatch an event if any error is occurred in Joomla

To log errors to a file, you can use the following:

jimport('joomla.log.log');

// Log errors to specific file.
JLog::addLogger(
   array(
      'text_file' => 'mod_mymodule.errors.php'
   ),
   JLog::ALL,
   'mod_mymodule'
);

This will create the following and store all error there:

root/logs/mod_mymodule.errors.php
You can of course change mod_mymodule to whatever you wish.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s