// inizio log
$db_log = JFactory::getDbo();
$query_log = $db_log->getQuery(true);
$columns_log = array('log');
$values_log = array($db_log->quote(' INSERIRE IL TESTO QUI'));
$query_log->insert($db_log->quoteName('log'));
$query_log->columns($db_log->quoteName($columns_log));
$query_log->values(implode(',', $values_log));
$db_log->setQuery($query_log);
$_log = $db_log->execute();
// fine log