From d1d4c6d8a5e3dd33fadab0304784cdc76a07be8b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?=
 <marcosgdf@gmail.com>
Date: Thu, 12 Jun 2014 11:45:32 +0200
Subject: [PATCH] Increased SQL Error to LOG_ERROR level

---
 htdocs/core/db/mssql.class.php  | 2 +-
 htdocs/core/db/mysql.class.php  | 2 +-
 htdocs/core/db/mysqli.class.php | 2 +-
 htdocs/core/db/pgsql.class.php  | 2 +-
 htdocs/core/db/sqlite.class.php | 4 ++--
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/htdocs/core/db/mssql.class.php b/htdocs/core/db/mssql.class.php
index 52c4fc85de1..02edeb7cf16 100644
--- a/htdocs/core/db/mssql.class.php
+++ b/htdocs/core/db/mssql.class.php
@@ -372,7 +372,7 @@ 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_WARNING);
+                dol_syslog(get_class($this)."::query SQL error: ".$query, 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 5e5b4c360d0..18e40264495 100644
--- a/htdocs/core/db/mysql.class.php
+++ b/htdocs/core/db/mysql.class.php
@@ -273,7 +273,7 @@ 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_WARNING);
+                dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR);
 			}
 			$this->lastquery=$query;
 			$this->_results = $ret;
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index 16915dcd22d..ed73d8621c0 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -275,7 +275,7 @@ 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_WARNING);
+                dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_ERROR);
             }
             $this->lastquery=$query;
             $this->_results = $ret;
diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php
index b5959df1f63..8ce4e700d66 100644
--- a/htdocs/core/db/pgsql.class.php
+++ b/htdocs/core/db/pgsql.class.php
@@ -506,7 +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_WARNING);
+				dol_syslog(get_class($this)."::query SQL error usesavepoint = ".$usesavepoint." - ".$query." - ".pg_last_error($this->db)." => ".$this->errno(), LOG_ERROR);
 				//print "\n>> ".$query."<br>\n";
 				//print '>> '.$this->lasterrno.' - '.$this->lasterror.' - '.$this->lastqueryerror."<br>\n";
 
diff --git a/htdocs/core/db/sqlite.class.php b/htdocs/core/db/sqlite.class.php
index 45c1bbd182f..39f33341526 100644
--- a/htdocs/core/db/sqlite.class.php
+++ b/htdocs/core/db/sqlite.class.php
@@ -409,8 +409,8 @@ 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_WARNING);
-                else dol_syslog(get_class($this)."::query SQL error: ".$query." ".$this->lasterrno, LOG_WARNING);
+                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);
             }
             $this->lastquery=$query;
             $this->_results = $ret;
-- 
GitLab