Merge pull request #3945 from nextcloud/downstream-27298
Adding file, line, class and function to the query logger (#27298)
This commit is contained in:
commit
450a899f01
|
@ -66,8 +66,11 @@ class OC_DB_StatementWrapper {
|
||||||
*/
|
*/
|
||||||
public function execute($input=array()) {
|
public function execute($input=array()) {
|
||||||
if(\OC::$server->getSystemConfig()->getValue( "log_query", false)) {
|
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));
|
$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;
|
$this->lastArguments = $input;
|
||||||
if (count($input) > 0) {
|
if (count($input) > 0) {
|
||||||
|
|
Loading…
Reference in New Issue