From 4e01371cd251a0f30b26540f22bbda3ea80945fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 28 Sep 2017 14:58:47 +0200 Subject: [PATCH] Log warnings count in debug log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michal Čihař --- libraries/classes/DatabaseInterface.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/classes/DatabaseInterface.php b/libraries/classes/DatabaseInterface.php index b3cd9b308d..9d5d52946d 100644 --- a/libraries/classes/DatabaseInterface.php +++ b/libraries/classes/DatabaseInterface.php @@ -303,11 +303,17 @@ class DatabaseInterface $time = microtime(true) - $time; $this->_dbgQuery($query, $link, $result, $time); if ($GLOBALS['cfg']['DBG']['sqllog']) { + $tmp = $this->_extension->realQuery(' + SHOW COUNT(*) WARNINGS', $link, DatabaseInterface::QUERY_STORE + ); + $warnings = $this->fetchRow($tmp); + openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_USER); + syslog( LOG_INFO, 'SQL[' . basename($_SERVER['SCRIPT_NAME']) . ']: ' - . sprintf('%0.3f', $time) . ' > ' . $query + . sprintf('%0.3f', $time) . '(W:' . $warnings[0] . ') > ' . $query ); closelog(); }