Show sql query when log level is lower than LOG_DEBUG
This commit is contained in:
parent
ad56cb4aa0
commit
f52b5a240a
@ -253,6 +253,8 @@ class DoliDBMysql extends DoliDB
|
|||||||
*/
|
*/
|
||||||
function query($query,$usesavepoint=0,$type='auto')
|
function query($query,$usesavepoint=0,$type='auto')
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$query = trim($query);
|
$query = trim($query);
|
||||||
|
|
||||||
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
|
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
|
||||||
@ -277,7 +279,8 @@ class DoliDBMysql extends DoliDB
|
|||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $this->errno();
|
$this->lasterrno = $this->errno();
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
|
||||||
|
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
$this->_results = $ret;
|
$this->_results = $ret;
|
||||||
|
|||||||
@ -255,6 +255,8 @@ class DoliDBMysqli extends DoliDB
|
|||||||
*/
|
*/
|
||||||
function query($query,$usesavepoint=0,$type='auto')
|
function query($query,$usesavepoint=0,$type='auto')
|
||||||
{
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
$query = trim($query);
|
$query = trim($query);
|
||||||
|
|
||||||
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
|
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
|
||||||
@ -278,6 +280,7 @@ class DoliDBMysqli extends DoliDB
|
|||||||
$this->lasterror = $this->error();
|
$this->lasterror = $this->error();
|
||||||
$this->lasterrno = $this->errno();
|
$this->lasterrno = $this->errno();
|
||||||
|
|
||||||
|
if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
|
||||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
|
||||||
}
|
}
|
||||||
$this->lastquery=$query;
|
$this->lastquery=$query;
|
||||||
|
|||||||
@ -509,11 +509,11 @@ class DoliDBPgsql extends 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(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
|
if ($conf->global->SYSLOG_LEVEL < LOG_DEBUG) dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR); // Log of request was not yet done previously
|
||||||
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
|
||||||
dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint, LOG_ERR);
|
dol_syslog(get_class($this)."::query SQL Error usesavepoint = ".$usesavepoint, LOG_ERR);
|
||||||
|
}
|
||||||
|
|
||||||
if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased
|
if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user