Add log for each request with error
This commit is contained in:
parent
10e0b270df
commit
9d781afe1d
@ -381,13 +381,13 @@ class DoliDb
|
|||||||
// Si requete utilisateur, on la sauvegarde ainsi que son resultset
|
// Si requete utilisateur, on la sauvegarde ainsi que son resultset
|
||||||
if (! $ret)
|
if (! $ret)
|
||||||
{
|
{
|
||||||
$this->lastqueryerror = $query;
|
|
||||||
|
|
||||||
$result = mssql_query("SELECT @@ERROR as code", $this->db);
|
$result = mssql_query("SELECT @@ERROR as code", $this->db);
|
||||||
$row = mssql_fetch_array($result);
|
$row = mssql_fetch_array($result);
|
||||||
|
|
||||||
|
$this->lastqueryerror = $query;
|
||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $row["code"];
|
$this->lasterrno = $row["code"];
|
||||||
|
dol_syslog("Mssql.lib::query SQL error: ".$query, LOG_ERR);
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
$this->results = $ret;
|
$this->results = $ret;
|
||||||
|
|||||||
@ -383,6 +383,7 @@ class DoliDb
|
|||||||
$this->lastqueryerror = $query;
|
$this->lastqueryerror = $query;
|
||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $this->errno();
|
$this->lasterrno = $this->errno();
|
||||||
|
dol_syslog("Mysql.lib::query SQL error: ".$query, LOG_ERR);
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
$this->results = $ret;
|
$this->results = $ret;
|
||||||
|
|||||||
@ -388,6 +388,7 @@ class DoliDb
|
|||||||
$this->lastqueryerror = $query;
|
$this->lastqueryerror = $query;
|
||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $this->errno();
|
$this->lasterrno = $this->errno();
|
||||||
|
dol_syslog("Mysqli.lib::query SQL error: ".$query, LOG_ERR);
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
$this->results = $ret;
|
$this->results = $ret;
|
||||||
|
|||||||
@ -511,7 +511,7 @@ class DoliDb
|
|||||||
$this->lastqueryerror = $query;
|
$this->lastqueryerror = $query;
|
||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $this->errno();
|
$this->lasterrno = $this->errno();
|
||||||
dol_syslog("Postgresql request error: ".$query, LOG_ERR);
|
dol_syslog("Pgsql.lib::query SQL error: ".$query, LOG_ERR);
|
||||||
//print "\n>> ".$query."<br>\n";
|
//print "\n>> ".$query."<br>\n";
|
||||||
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."<br>\n";
|
//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."<br>\n";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user