File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -367,6 +367,12 @@ protected function logQueryToFile(string $sql): void {
367367 if ($ this ->systemConfig ->getValue ('query_log_file_requestid ' ) === 'yes ' ) {
368368 $ prefix .= \OC ::$ server ->get (IRequestId::class)->getId () . "\t" ;
369369 }
370+ $ postfix = '' ;
371+ if ($ this ->systemConfig ->getValue ('query_log_file_backtrace ' ) === 'yes ' ) {
372+ $ trace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS );
373+ array_pop ($ trace );
374+ $ postfix .= '; ' . json_encode ($ trace );
375+ }
370376
371377 // FIXME: Improve to log the actual target db host
372378 $ isPrimary = $ this ->connections ['primary ' ] === $ this ->_conn ;
@@ -375,7 +381,7 @@ protected function logQueryToFile(string $sql): void {
375381
376382 file_put_contents (
377383 $ this ->systemConfig ->getValue ('query_log_file ' , '' ),
378- $ prefix . $ sql . "\n" ,
384+ $ prefix . $ sql . $ postfix . "\n" ,
379385 FILE_APPEND
380386 );
381387 }
You can’t perform that action at this time.
0 commit comments