×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Сергій Савченко
Added: Aug 20, 2014 2:29 PM
Views: 22
  1. jimport('joomla.log.log');
  2.  
  3. JLog::addLogger(
  4.        array(
  5.             // Sets file name
  6.             'text_file' => 'com_helloworld.errors.php'
  7.        ),
  8.        // Sets messages of all log levels to be sent to the file
  9.        JLog::ALL,
  10.        // The log category/categories which should be recorded in this file
  11.        // In this case, it's just the one category from our extension, still
  12.        // we need to put it inside an array
  13.        array('com_helloworld')
  14.    );
  15.  
  16. JLog::add(JText::_('JTEXT_ERROR_MESSAGE'), JLog::WARNING, 'com_helloworld');