aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/Connection.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2024-01-29 11:41:45 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2024-01-30 10:31:03 +0100
commit911ab393c07d7e2f29e8949d422b122ca91be354 (patch)
tree1aada03b8bc7c715838f11cf5cb2f2c33962c774 /lib/private/DB/Connection.php
parent063c051cdcfbaf1f623337f6f1239438b35d094c (diff)
downloadnextcloud-server-911ab393c07d7e2f29e8949d422b122ca91be354.tar.gz
nextcloud-server-911ab393c07d7e2f29e8949d422b122ca91be354.zip
feat(db): Make dirty query logging available in production
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/DB/Connection.php')
-rw-r--r--lib/private/DB/Connection.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index 09c321aedb8..5affa2c3d48 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -276,7 +276,15 @@ class Connection extends PrimaryReadReplicaConnection {
} else {
// Read to a table that has been written to previously
// While this might not necessarily mean that we did a read after write it is an indication for a code path to check
- $this->logger->debug('dirty table reads: ' . $sql, ['tables' => $this->tableDirtyWrites, 'reads' => $tables, 'exception' => new \Exception()]);
+ $this->logger->log(
+ (int) ($this->systemConfig->getValue('loglevel_dirty_database_queries', null) ?? 0),
+ 'dirty table reads: ' . $sql,
+ [
+ 'tables' => $this->tableDirtyWrites,
+ 'reads' => $tables,
+ 'exception' => new \Exception(),
+ ],
+ );
}
$sql = $this->replaceTablePrefix($sql);