diff options
author | Robin Appelman <robin@icewind.nl> | 2016-08-24 14:37:15 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-08-24 14:37:15 +0200 |
commit | 1c3b1e5797da8a7a398a59a353e1616ba518fc59 (patch) | |
tree | 79b13f1607f80a3b9e6e314193bf52de271c19e6 /lib/private/Diagnostics/QueryLogger.php | |
parent | 8d8366762be728f10af7ae9e465dcdba727d0eaf (diff) | |
download | nextcloud-server-1c3b1e5797da8a7a398a59a353e1616ba518fc59.tar.gz nextcloud-server-1c3b1e5797da8a7a398a59a353e1616ba518fc59.zip |
add stacktrace to query logger
Diffstat (limited to 'lib/private/Diagnostics/QueryLogger.php')
-rw-r--r-- | lib/private/Diagnostics/QueryLogger.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/Diagnostics/QueryLogger.php b/lib/private/Diagnostics/QueryLogger.php index 5cf7e0689f8..a30f8c7b02a 100644 --- a/lib/private/Diagnostics/QueryLogger.php +++ b/lib/private/Diagnostics/QueryLogger.php @@ -42,7 +42,15 @@ class QueryLogger implements IQueryLogger { * @param array $types */ public function startQuery($sql, array $params = null, array $types = null) { - $this->activeQuery = new Query($sql, $params, microtime(true)); + $this->activeQuery = new Query($sql, $params, microtime(true), $this->getStack()); + } + + private function getStack() { + $stack = debug_backtrace(); + array_shift($stack); + array_shift($stack); + array_shift($stack); + return $stack; } public function stopQuery() { |