jimport('joomla.log.log'); //import this file on top of the file //write db log code inside your function JLog::addLogger( array( //Sets file name 'text_file' => 'com_test.errors.php' ), //Sets all JLog messages to be set to the file JLog::ALL, //Chooses a component name 'com_test' ); //insertion code :- if(!$db->insertObject($table_name, $final_array, 'id')){ $logEntry = $db->stderr(); //logentry variable // Log my extension errors only. JLog::add($logEntry, JLog::WARNING, 'com_test'); return false; }
Logs shall be stored in yoursiteroot/logs/com_test.errors.php
By accepting you will be accessing a service provided by a third-party external to https://techjoomla.com/