diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index e90e0fc626e..69ee6b7dbb8 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -158,7 +158,7 @@ class Categorie extends CommonObject
$this->db->begin();
- dol_syslog(get_class($this).'::create sql='.$sql);
+ dol_syslog(get_class($this).'::create', LOG_DEBUG);
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie (";
$sql.= "fk_parent,";
$sql.= " label,";
@@ -472,7 +472,7 @@ class Categorie extends CommonObject
$sql = "INSERT INTO ".MAIN_DB_PREFIX."categorie_".$type." (fk_categorie, fk_".$column_name.")";
$sql .= " VALUES (".$this->id.", ".$obj->id.")";
- dol_syslog(get_class($this).'::add_type sql='.$sql);
+ dol_syslog(get_class($this).'::add_type', LOG_DEBUG);
if ($this->db->query($sql))
{
if (! empty($conf->global->CATEGORIE_RECURSIV_ADD))
@@ -567,7 +567,7 @@ class Categorie extends CommonObject
$sql .= " WHERE fk_categorie = ".$this->id;
$sql .= " AND fk_".$column_name." = ".$obj->id;
- dol_syslog(get_class($this).'::del_type sql='.$sql);
+ dol_syslog(get_class($this).'::del_type', LOG_DEBUG);
if ($this->db->query($sql))
{
// Save object we want to unlink category off into category instance to provide information to trigger
@@ -1136,7 +1136,7 @@ class Categorie extends CommonObject
$sql.= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".$table." = ".$id." AND c.type = ".$typeid;
$sql.= " AND c.entity IN (".getEntity('category',1).")";
- dol_syslog(get_class($this).'::containing sql='.$sql);
+ dol_syslog(get_class($this).'::containing', LOG_DEBUG);
$res = $this->db->query($sql);
if ($res)
{
diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php
index 78d2b14c7bc..18f03f28ca9 100644
--- a/htdocs/comm/list.php
+++ b/htdocs/comm/list.php
@@ -149,7 +149,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit +1, $offset);
-dol_syslog('comm/list.php: sql='.$sql,LOG_DEBUG);
+dol_syslog('comm/list.php:', LOG_DEBUG);
$result = $db->query($sql);
if ($result)
{
diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php
index 31b6fc67468..52bc77afa71 100644
--- a/htdocs/comm/propal/class/propal.class.php
+++ b/htdocs/comm/propal/class/propal.class.php
@@ -1327,7 +1327,7 @@ class Propal extends CommonObject
$sql.= " fk_statut = 1, date_valid='".$this->db->idate($now)."', fk_user_valid=".$user->id;
$sql.= " WHERE rowid = ".$this->id." AND fk_statut = 0";
- dol_syslog(get_class($this).'::valid sql='.$sql);
+ dol_syslog(get_class($this).'::valid', LOG_DEBUG);
if ($this->db->query($sql))
{
if (! $notrigger)
@@ -2633,7 +2633,7 @@ class Propal extends CommonObject
$sql.= ' WHERE pt.fk_propal = '.$this->id;
$sql.= ' ORDER BY pt.rang ASC, pt.rowid';
- dol_syslog(get_class($this).'::getLinesArray sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::getLinesArray', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -2921,7 +2921,7 @@ class PropaleLigne extends CommonObject
$sql.= " ".(! empty($this->date_end)?"'".$this->db->idate($this->date_end)."'":"null");
$sql.= ')';
- dol_syslog(get_class($this).'::insert sql='.$sql, LOG_DEBUG);
+ dol_syslog(get_class($this).'::insert', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php
index 58a384df6d0..d4b47283bf3 100644
--- a/htdocs/comm/prospect/list.php
+++ b/htdocs/comm/prospect/list.php
@@ -233,7 +233,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= " ORDER BY $sortfield $sortorder, s.nom ASC";
$sql.= $db->plimit($conf->liste_limit+1, $offset);
-dol_syslog('comm/prospect/list.php sql='.$sql,LOG_DEBUG);
+dol_syslog('comm/prospect/list.php', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index 71405a54feb..d30c1519f10 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -145,7 +145,7 @@ $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1,$offset);
//print $sql;
-dol_syslog('compta/bank/search.php:: sql='.$sql);
+dol_syslog('compta/bank/search.php::', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/compta/deplacement/class/deplacement.class.php b/htdocs/compta/deplacement/class/deplacement.class.php
index d46585c300d..942ceb912c8 100644
--- a/htdocs/compta/deplacement/class/deplacement.class.php
+++ b/htdocs/compta/deplacement/class/deplacement.class.php
@@ -415,7 +415,7 @@ class Deplacement extends CommonObject
$sql.= ' FROM '.MAIN_DB_PREFIX.'deplacement as c';
$sql.= ' WHERE c.rowid = '.$id;
- dol_syslog(get_class($this).'::info sql='.$sql);
+ dol_syslog(get_class($this).'::info', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 36ea7739652..d8b5914113d 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -955,7 +955,7 @@ class Facture extends CommonInvoice
$sql.= ' WHERE l.fk_facture = '.$this->id;
$sql.= ' ORDER BY l.rang';
- dol_syslog(get_class($this).'::fetch_lines sql='.$sql, LOG_DEBUG);
+ dol_syslog(get_class($this).'::fetch_lines', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 71c9dc44d81..7e0626593cb 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -177,7 +177,7 @@ class Paiement extends CommonObject
$sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount)';
$sql .= ' VALUES ('.$facid.', '. $this->id.', \''.$amount.'\')';
- dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture sql='.$sql);
+ dol_syslog(get_class($this).'::Create Amount line '.$key.' insert paiement_facture', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -553,7 +553,7 @@ class Paiement extends CommonObject
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' set fk_bank = '.$id_bank;
$sql.= ' WHERE rowid = '.$this->id;
- dol_syslog(get_class($this).'::update_fk_bank sql='.$sql);
+ dol_syslog(get_class($this).'::update_fk_bank', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
@@ -639,7 +639,7 @@ class Paiement extends CommonObject
{
$sql = 'UPDATE '.MAIN_DB_PREFIX.$this->table_element.' SET statut = 1 WHERE rowid = '.$this->id;
- dol_syslog(get_class($this).'::valide sql='.$sql);
+ dol_syslog(get_class($this).'::valide', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
{
@@ -663,7 +663,7 @@ class Paiement extends CommonObject
$sql.= ' FROM '.MAIN_DB_PREFIX.'paiement as p';
$sql.= ' WHERE p.rowid = '.$id;
- dol_syslog(get_class($this).'::info sql='.$sql);
+ dol_syslog(get_class($this).'::info', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result)
@@ -726,7 +726,7 @@ class Paiement extends CommonObject
else
{
$this->error=$this->db->error();
- dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' - sql='.$sql);
+ dol_syslog(get_class($this).'::getBillsArray Error '.$this->error.' -', LOG_DEBUG);
return -1;
}
}
diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php
index 3413548c1fd..32038c61928 100644
--- a/htdocs/core/boxes/box_ficheinter.php
+++ b/htdocs/core/boxes/box_ficheinter.php
@@ -79,7 +79,7 @@ class box_ficheinter extends ModeleBoxes
$sql.= " ORDER BY f.tms DESC";
$sql.= $db->plimit($max, 0);
- dol_syslog(get_class($this).'::loadBox sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::loadBox', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 0c366cb561f..8ff3b515d94 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -653,7 +653,7 @@ abstract class CommonObject
$sql = "SELECT rowid, code, libelle as label, coder";
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
$sql.= " WHERE rowid = ".$idtype;
- dol_syslog(get_class($this).'::fetch_barcode sql='.$sql);
+ dol_syslog(get_class($this).'::fetch_barcode', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -739,7 +739,7 @@ abstract class CommonObject
$sql.= " WHERE ".$field." = '".$key."'";
$sql.= " AND entity = ".$conf->entity;
- dol_syslog(get_class($this).'::fetchObjectFrom sql='.$sql);
+ dol_syslog(get_class($this).'::fetchObjectFrom', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -765,7 +765,7 @@ abstract class CommonObject
$sql = "SELECT ".$field." FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE rowid = ".$id;
- dol_syslog(get_class($this).'::getValueFrom sql='.$sql);
+ dol_syslog(get_class($this).'::getValueFrom', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -2484,7 +2484,7 @@ abstract class CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."det";
$sql.= " WHERE ".$this->fk_element." = ".$this->id;
- dol_syslog(get_class($this).'::getTotalDiscount sql='.$sql);
+ dol_syslog(get_class($this).'::getTotalDiscount', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 84279b7eb9e..6ae98a3c8d2 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -399,7 +399,7 @@ class ExtraFields
{
$sql="ALTER TABLE ".MAIN_DB_PREFIX.$table." DROP INDEX uk_".$table."_".$attrname;
}
- dol_syslog(get_class($this).'::update sql='.$sql);
+ dol_syslog(get_class($this).'::update', LOG_DEBUG);
$resql=$this->db->query($sql,1,'dml');
return 1;
}
@@ -754,7 +754,7 @@ class ExtraFields
$sql.=preg_replace('/^ AND /','',$sqlwhere);
//print $sql;
- dol_syslog(get_class($this).'::showInputField type=sellist sql='.$sql);
+ dol_syslog(get_class($this).'::showInputField type=sellist', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -964,7 +964,7 @@ class ExtraFields
$sql.= " WHERE ".$selectkey."='".$this->db->escape($value)."'";
//$sql.= ' AND entity = '.$conf->entity;
- dol_syslog(get_class($this).':showOutputField:$type=sellist sql='.$sql);
+ dol_syslog(get_class($this).':showOutputField:$type=sellist', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index c83bbf6864c..d6c1926361b 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -604,7 +604,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees as c";
$sql.= " ORDER BY lower(c.libelle) ASC";
- dol_syslog(get_class($this).'::load_cache_types_fees sql='.$sql, LOG_DEBUG);
+ dol_syslog(get_class($this).'::load_cache_types_fees', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -1554,7 +1554,7 @@ class Form
$sql.= " ORDER BY date_price";
$sql.= " DESC LIMIT 1";
- dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.' sql='.$sql);
+ dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);
$result2 = $this->db->query($sql);
if ($result2)
{
@@ -2055,7 +2055,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX.'c_payment_term';
$sql.= " WHERE active=1";
$sql.= " ORDER BY sortorder";
- dol_syslog(get_class($this).'::load_cache_conditions_paiements sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::load_cache_conditions_paiements', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -2094,7 +2094,7 @@ class Form
$sql.= " FROM ".MAIN_DB_PREFIX.'c_availability';
$sql.= " WHERE active=1";
$sql.= " ORDER BY rowid";
- dol_syslog(get_class($this).'::load_cache_availability sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::load_cache_availability', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index 2f1be6d7d56..b970283cbf2 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -65,7 +65,7 @@ class FormCompany
$sql.= " WHERE active = 1";
if ($filter) $sql.=" ".$filter;
$sql.= " ORDER by id";
- dol_syslog(get_class($this).'::typent_array sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::typent_array', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -104,7 +104,7 @@ class FormCompany
$sql.= " WHERE active = 1";
if ($filter) $sql.=" ".$filter;
$sql .= " ORDER BY id ASC";
- dol_syslog(get_class($this).'::effectif_array sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::effectif_array', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index 35ebe48e168..f51cf060af8 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -169,7 +169,7 @@ class FormOther
$sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid";
$sql.= " ORDER BY pays, e.organization ASC, e.code ASC";
- dol_syslog(get_class($this).'::select_ecotaxes sql='.$sql);
+ dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
@@ -227,7 +227,7 @@ class FormOther
$sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid";
$sql.= " AND p.code = '".$country_code."'";
- dol_syslog(get_class($this).'::select_revenue_stamp sql='.$sql);
+ dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/class/html.formprojet.class.php b/htdocs/core/class/html.formprojet.class.php
index 1ea498e19dd..11e32ee8a84 100644
--- a/htdocs/core/class/html.formprojet.class.php
+++ b/htdocs/core/class/html.formprojet.class.php
@@ -197,7 +197,7 @@ class FormProjets
$sql.= ' AND entity='.$conf->entity;
$sql.= " ORDER BY ref DESC";
- dol_syslog(get_class($this).'::select_element sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index a7cabd9468d..d3ae00c495e 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -674,7 +674,7 @@ class Translate
$sql = "SELECT ".$fieldlabel." as label";
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
$sql.= " WHERE ".$fieldkey." = '".($keyforselect?$keyforselect:$key)."'";
- dol_syslog(get_class($this).'::getLabelFromKey sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::getLabelFromKey', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
@@ -754,7 +754,7 @@ class Translate
if (! empty($currency_code)) $sql.=" AND code_iso = '".$currency_code."'";
//$sql.= " ORDER BY code_iso ASC"; // Not required, a sort is done later
- dol_syslog(get_class($this).'::loadCacheCurrencies sql='.$sql, LOG_DEBUG);
+ dol_syslog(get_class($this).'::loadCacheCurrencies', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php
index 02edeb7cf16..01e16749f5a 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -372,7 +372,8 @@ class DoliDBMssql extends DoliDB
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
$this->lasterrno = $row["code"];
- dol_syslog(get_class($this)."::query SQL error: ".$query, LOG_ERROR);
+
+ dol_syslog(get_class($this)."::query SQL error: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERROR);
}
$this->lastquery=$query;
$this->_results = $ret;
diff --git a/htdocs/core/db/mysql.class.php b/htdocs/core/db/mysql.class.php
index 18e40264495..3f238739026 100644
--- a/htdocs/core/db/mysql.class.php
+++ b/htdocs/core/db/mysql.class.php
@@ -273,7 +273,9 @@ class DoliDBMysql extends DoliDB
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
- dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR);
+
+ dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERROR);
+ dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERROR);
}
$this->lastquery=$query;
$this->_results = $ret;
@@ -829,21 +831,14 @@ class DoliDBMysql extends DoliDB
{
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
- else
- {
- // If user already exists, we continue to set permissions
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
- }
}
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
@@ -853,7 +848,6 @@ class DoliDBMysql extends DoliDB
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index ed73d8621c0..60bef497f31 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -275,7 +275,8 @@ class DoliDBMysqli extends DoliDB
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
- dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR);
+
+ dol_syslog(get_class($this)."::query SQL error: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERROR);
}
$this->lastquery=$query;
$this->_results = $ret;
@@ -833,21 +834,14 @@ class DoliDBMysqli extends DoliDB
{
if ($this->lasterrno != 'DB_ERROR_USER_ALREADY_EXISTS')
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
- else
- {
- // If user already exists, we continue to set permissions
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
- }
}
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
@@ -857,7 +851,6 @@ class DoliDBMysqli extends DoliDB
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index 8ce4e700d66..69e1a92717e 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -506,9 +506,7 @@ class DoliDBPgsql extends DoliDB
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
}
- dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_ERROR);
- //print "\n>> ".$query."
\n";
- //print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."
\n";
+ dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$this->lasterror." (".$this->lasterrno.")", LOG_ERROR);
if ($usesavepoint && $this->transaction_opened) // Warning, after that errno will be erased
{
diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php
index 39f33341526..37bbb91b390 100644
--- a/htdocs/core/db/sqlite.class.php
+++ b/htdocs/core/db/sqlite.class.php
@@ -409,8 +409,14 @@ class DoliDBSqlite extends DoliDB
$this->lastqueryerror = $query;
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
- if (preg_match('/[0-9]/',$this->lasterrno)) dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno." ".$this->lasterror, LOG_ERROR);
- else dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR);
+
+ $errormsg = get_class($this)."::query SQL error: ".$this->lasterror;
+
+ if (preg_match('/[0-9]/',$this->lasterrno)) {
+ $errormsg .= ' ('.$this->lasterrno.')';
+ }
+
+ dol_syslog($errormsg, LOG_ERROR);
}
$this->lastquery=$query;
$this->_results = $ret;
@@ -972,7 +978,6 @@ class DoliDBSqlite extends DoliDB
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
@@ -985,7 +990,6 @@ class DoliDBSqlite extends DoliDB
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
@@ -995,7 +999,6 @@ class DoliDBSqlite extends DoliDB
$resql=$this->query($sql);
if (! $resql)
{
- dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_ERR);
return -1;
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 9bf8bead072..bd5f19e2401 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -655,7 +655,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
if ($search_name) $sql .= " AND (p.lastname LIKE '%".$db->escape($search_name)."%' OR p.firstname LIKE '%".$db->escape($search_name)."%')";
$sql.= " ORDER BY $sortfield $sortorder";
- dol_syslog('core/lib/company.lib.php :: show_contacts sql='.$sql,LOG_DEBUG);
+ dol_syslog('core/lib/company.lib.php :: show_contacts', LOG_DEBUG);
$result = $db->query($sql);
$num = $db->num_rows($result);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 1cd4f582494..bcbfc62f354 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -4197,7 +4197,7 @@ function dol_getIdFromCode($db,$key,$tablename,$fieldkey='code',$fieldid='id')
$sql = "SELECT ".$fieldid." as id";
$sql.= " FROM ".MAIN_DB_PREFIX.$tablename;
$sql.= " WHERE ".$fieldkey." = '".$key."'";
- dol_syslog('dol_getIdFromCode sql='.$sql, LOG_DEBUG);
+ dol_syslog('dol_getIdFromCode', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 606589971a9..e6a9e139109 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1293,7 +1293,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
- dol_syslog('/core/lib/function2.lib.php::getListOfModels sql='.$sql, LOG_DEBUG);
+ dol_syslog('/core/lib/function2.lib.php::getListOfModels', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index fbf3cc5c6b0..8eb0c33d11f 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -302,7 +302,7 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$sql .= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql .= " WHERE p.fk_soc = ".$object->id;
- dol_syslog('doc_generic_odt :: sql='.$sql,LOG_DEBUG);
+ dol_syslog('doc_generic_odt ::', LOG_DEBUG);
$result = $this->db->query($sql);
$num = $this->db->num_rows($result);
diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php
index d72291c6038..03bfa9b9a71 100644
--- a/htdocs/fourn/class/fournisseur.product.class.php
+++ b/htdocs/fourn/class/fournisseur.product.class.php
@@ -201,7 +201,7 @@ class ProductFournisseur extends Product
$sql.= " WHERE rowid = ".$this->product_fourn_price_id;
// TODO Add price_base_type and price_ttc
- dol_syslog(get_class($this).'::update_buyprice sql='.$sql);
+ dol_syslog(get_class($this).'::update_buyprice', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
@@ -238,7 +238,7 @@ class ProductFournisseur extends Product
// Delete price for this quantity
$sql = "DELETE FROM ".MAIN_DB_PREFIX."product_fournisseur_price";
$sql.= " WHERE fk_soc = ".$fourn->id." AND ref_fourn = '".$this->db->escape($ref_fourn)."' AND quantity = ".$qty." AND entity = ".$conf->entity;
- dol_syslog(get_class($this).'::update_buyprice sql='.$sql);
+ dol_syslog(get_class($this).'::update_buyprice', LOG_DEBUG);
$resql=$this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/fourn/class/paiementfourn.class.php b/htdocs/fourn/class/paiementfourn.class.php
index 3daee072886..4d87adf424f 100644
--- a/htdocs/fourn/class/paiementfourn.class.php
+++ b/htdocs/fourn/class/paiementfourn.class.php
@@ -382,7 +382,7 @@ class PaiementFourn extends Paiement
$sql.= ' WHERE pf.fk_facturefourn = f.rowid AND fk_paiementfourn = '.$this->id;
if ($filter) $sql.= ' AND '.$filter;
- dol_syslog(get_class($this).'::getBillsArray sql='.$sql,LOG_DEBUG);
+ dol_syslog(get_class($this).'::getBillsArray', LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql)
{
diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php
index 81837feb41f..341f3ffca54 100644
--- a/htdocs/fourn/liste.php
+++ b/htdocs/fourn/liste.php
@@ -118,7 +118,7 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($conf->liste_limit+1, $offset);
-dol_syslog('fourn/liste.php: sql='.$sql,LOG_DEBUG);
+dol_syslog('fourn/liste.php:', LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 995f33e62ff..1c90692d5a4 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -834,7 +834,7 @@ class Holiday extends CommonObject
$sql.= " value = '".$value."'";
$sql.= " WHERE name = '".$name."'";
- dol_syslog(get_class($this).'::updateConfCP name='.$name.' sql='.$sql);
+ dol_syslog(get_class($this).'::updateConfCP name='.$name.'', LOG_DEBUG);
$result = $this->db->query($sql);
if($result) {
return true;
@@ -855,7 +855,7 @@ class Holiday extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_config";
$sql.= " WHERE name = '".$name."'";
- dol_syslog(get_class($this).'::getConfCP name='.$name.' sql='.$sql);
+ dol_syslog(get_class($this).'::getConfCP name='.$name.'', LOG_DEBUG);
$result = $this->db->query($sql);
// Si pas d'erreur
@@ -903,7 +903,7 @@ class Holiday extends CommonObject
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
$sql.= " WHERE name = 'lastUpdate'";
- dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
+ dol_syslog(get_class($this).'::updateSoldeCP', LOG_DEBUG);
$result = $this->db->query($sql);
// On ajoute x jours à chaque utilisateurs
@@ -948,7 +948,7 @@ class Holiday extends CommonObject
$sql.= " nb_holiday = ".$nbHoliday;
$sql.= " WHERE fk_user = '".$userID."'";
- dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
+ dol_syslog(get_class($this).'::updateSoldeCP', LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) return 1;
@@ -1040,7 +1040,7 @@ class Holiday extends CommonObject
$sql.= " FROM ".MAIN_DB_PREFIX."holiday_users";
$sql.= " WHERE fk_user = '".$user_id."'";
- dol_syslog(get_class($this).'::getCPforUser sql='.$sql);
+ dol_syslog(get_class($this).'::getCPforUser', LOG_DEBUG);
$result = $this->db->query($sql);
if($result) {
$obj = $this->db->fetch_object($result);
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index f167422f503..9427a861590 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -81,7 +81,7 @@ if ($action == 'update' && isset($_POST['update_cp']))
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
$sql.= " WHERE name = 'lastUpdate' and value IS NULL"; // Add value IS NULL to be sure to update only at init.
- dol_syslog('define_holiday update lastUpdate entry sql='.$sql);
+ dol_syslog('define_holiday update lastUpdate entry', LOG_DEBUG);
$result = $db->query($sql);
$mesg='