I'm trying to make a script to update components and I want to retrieve the logs to check the execution of all the requests related to the update of a component.
In the script I use Joomla methods, external to my script, so I need to activate the debug variable dynamically from the configuration file to log all the queries executed. (I get them with JDatabaseDriver::getLog())
In the case where I activate the debug before the execution of the script, everything goes as planned, I have my logs.
But when I activate it from the script, my logs are empty. The debug variable goes to true (in the conf file), but that seems to have no effect at the script level, I don't get the logs.
Do you have an idea to solve this problem or work around it?
Sorry for my poor English... Thanks in advance and have a nice day!
Edit :
Code use to change debug to true :
$config = JFactory::getConfig();
$config->set('debug', '1');
Method use to get statements logs :
private function getElementLogs() {
$logs = $this->db->getLog();
if($this->logs) {
foreach ($logs as $key => $value) {
if ($logs[$key] == $this->logs[$key] AND isset($logs[$key])) {
unset($logs[$key]);
}
}
}
$this->logs = $this->db->getLog();
return $logs;
}