From: Michael J. Rubinsky Date: Tue, 7 Dec 2010 14:30:05 +0000 (-0500) Subject: Exceptions should be logged at error level, not debug. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=864d3e31153b28c99b9a21962ddfff18a54375d0;p=horde.git Exceptions should be logged at error level, not debug. Bug: 9430 --- diff --git a/framework/Db/lib/Horde/Db/Adapter/Base.php b/framework/Db/lib/Horde/Db/Adapter/Base.php index e17e55b18..35c654974 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Base.php +++ b/framework/Db/lib/Horde/Db/Adapter/Base.php @@ -523,7 +523,7 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter try { $stmt = $this->_connection->query($sql); } catch (Exception $e) { - $this->_logInfo($sql, 'QUERY FAILED: ' . $e->getMessage()); + $this->_logError($sql, 'QUERY FAILED: ' . $e->getMessage()); $this->_logInfo($sql, $name); throw new Horde_Db_Exception((string)$e->getMessage(), (int)$e->getCode()); } @@ -754,6 +754,14 @@ abstract class Horde_Db_Adapter_Base implements Horde_Db_Adapter $this->_logger->debug($this->_formatLogEntry($name, $sql)); } + protected function _logError($error, $name, $runtime = null) + { + /*@TODO */ + $name = (empty($name) ? '' : $name) + . (empty($runtime) ? '' : sprintf(" (%.4fs)", $runtime)); + $this->_logger->err($this->_formatLogEntry($name, $sql)); + } + /** * Formats the log entry. *