aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2017-03-20 13:16:10 +0100
committerGitHub <noreply@github.com>2017-03-20 13:16:10 +0100
commit450a899f012efd60ba83f8222116a0ca1a1facf9 (patch)
tree9fc7c43cda74a1f40c5bc7bd72b4092ea50d6079 /lib
parent29039eb608e03c9e2e28082de05812fd948e1441 (diff)
parent45567572c8e82a2aaf2900d455936c91ec2895dc (diff)
downloadnextcloud-server-450a899f012efd60ba83f8222116a0ca1a1facf9.tar.gz
nextcloud-server-450a899f012efd60ba83f8222116a0ca1a1facf9.zip
Merge pull request #3945 from nextcloud/downstream-27298
Adding file, line, class and function to the query logger (#27298)
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/db/statementwrapper.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/legacy/db/statementwrapper.php b/lib/private/legacy/db/statementwrapper.php
index 0c3a6ea62a2..dedaf2d8cef 100644
--- a/lib/private/legacy/db/statementwrapper.php
+++ b/lib/private/legacy/db/statementwrapper.php
@@ -66,8 +66,11 @@ class OC_DB_StatementWrapper {
*/
public function execute($input=array()) {
if(\OC::$server->getSystemConfig()->getValue( "log_query", false)) {
+ $backTrace = debug_backtrace();
+ $class = $backTrace[1]['class'] . ':' . $backTrace[1]['function'];
+ $file = substr($backTrace[0]['file'], strlen(\OC::$SERVERROOT)) . ':' . $backTrace[0]['line'];
$params_str = str_replace("\n", " ", var_export($input, true));
- \OCP\Util::writeLog('core', 'DB execute with arguments : '.$params_str, \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('core', "DB execute with arguments : $params_str in $class; $file", \OCP\Util::DEBUG);
}
$this->lastArguments = $input;
if (count($input) > 0) {