summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <DeepDiver1975@users.noreply.github.com>2017-03-06 11:44:25 +0100
committerMorris Jobke <hey@morrisjobke.de>2017-03-19 23:39:51 -0600
commit45567572c8e82a2aaf2900d455936c91ec2895dc (patch)
treefb2547f4ee408fe4a1fc00d16991c6f330c61774 /lib/private
parent528a903a7b23ea628e6ec2fc9a221821297c0bec (diff)
downloadnextcloud-server-45567572c8e82a2aaf2900d455936c91ec2895dc.tar.gz
nextcloud-server-45567572c8e82a2aaf2900d455936c91ec2895dc.zip
Adding file, line, class and function to the query logger (#27298)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private')
-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) {