Commit 8e7dddea authored by Till Brehm's avatar Till Brehm

Fixed #4939 unability to insert into sys_log is an iterative tipping point, stalling systems

Added a third parameter to $app->log() function in server part to turn off logging to database and use this option in mysql lib to not log any server side SQL errors to the database.
parent 03a40c77
......@@ -117,7 +117,7 @@ class app {
2 = ERROR
*/
function log($msg, $priority = 0) {
function log($msg, $priority = 0, $dblog = true) {
global $conf;
......@@ -148,7 +148,7 @@ class app {
fclose($fp);
// Log to database
if(isset($this->dbmaster)) {
if($dblog === true && isset($this->dbmaster)) {
$server_id = $conf['server_id'];
$loglevel = $priority;
$message = $msg;
......
......@@ -476,7 +476,7 @@ class db
if($this->show_error_messages && $conf['demo_mode'] === false) {
echo $sErrormsg . $sAddMsg;
} elseif(is_object($app) && method_exists($app, 'log') && $bNoLog == false) {
$app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN);
$app->log($sErrormsg . $sAddMsg . ' -> ' . $mysql_errno . ' (' . $mysql_error . ')', LOGLEVEL_WARN, false);
} elseif(php_sapi_name() == 'cli') {
echo $sErrormsg . $sAddMsg;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment