We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bf6911 commit ebb1349Copy full SHA for ebb1349
1 file changed
lib/private/DB/Connection.php
@@ -302,10 +302,16 @@ protected function logQueryToFile(string $sql): void {
302
if ($this->systemConfig->getValue('query_log_file_requestid') === 'yes') {
303
$prefix .= \OC::$server->get(IRequestId::class)->getId() . "\t";
304
}
305
+ $postfix = '';
306
+ if ($this->systemConfig->getValue('query_log_file_backtrace') === 'yes') {
307
+ $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
308
+ array_pop($trace);
309
+ $postfix .= '; ' . json_encode($trace);
310
+ }
311
312
file_put_contents(
313
$this->systemConfig->getValue('query_log_file', ''),
- $prefix . $sql . "\n",
314
+ $prefix . $sql . $postfix . "\n",
315
FILE_APPEND
316
);
317
0 commit comments