aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Memcache/Factory.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2021-12-01 16:30:45 +0100
committerJoas Schilling <coding@schilljs.com>2021-12-01 22:33:41 +0100
commit168c673755eca62008d9bfa81d0185beba1ff24b (patch)
tree11a6a7c57788af6bb5dbdef9216e305e37c2f99d /lib/private/Memcache/Factory.php
parent44ecd0d1d5f77e6798c1dd08da8120ba86585758 (diff)
downloadnextcloud-server-168c673755eca62008d9bfa81d0185beba1ff24b.tar.gz
nextcloud-server-168c673755eca62008d9bfa81d0185beba1ff24b.zip
Allow to log DB, redis and LDAP requests into files
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Memcache/Factory.php')
-rw-r--r--lib/private/Memcache/Factory.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php
index 08f19e11ef3..7791c4beae9 100644
--- a/lib/private/Memcache/Factory.php
+++ b/lib/private/Memcache/Factory.php
@@ -64,16 +64,21 @@ class Factory implements ICacheFactory {
*/
private $lockingCacheClass;
+ /** @var string */
+ private $logFile;
+
/**
* @param string $globalPrefix
* @param ILogger $logger
* @param string|null $localCacheClass
* @param string|null $distributedCacheClass
* @param string|null $lockingCacheClass
+ * @param string $logFile
*/
public function __construct(string $globalPrefix, ILogger $logger,
- $localCacheClass = null, $distributedCacheClass = null, $lockingCacheClass = null) {
+ $localCacheClass = null, $distributedCacheClass = null, $lockingCacheClass = null, string $logFile = '') {
$this->logger = $logger;
+ $this->logFile = $logFile;
$this->globalPrefix = $globalPrefix;
if (!$localCacheClass) {
@@ -112,7 +117,7 @@ class Factory implements ICacheFactory {
* @return IMemcache
*/
public function createLocking(string $prefix = ''): IMemcache {
- return new $this->lockingCacheClass($this->globalPrefix . '/' . $prefix);
+ return new $this->lockingCacheClass($this->globalPrefix . '/' . $prefix, $this->logFile);
}
/**
@@ -122,7 +127,7 @@ class Factory implements ICacheFactory {
* @return ICache
*/
public function createDistributed(string $prefix = ''): ICache {
- return new $this->distributedCacheClass($this->globalPrefix . '/' . $prefix);
+ return new $this->distributedCacheClass($this->globalPrefix . '/' . $prefix, $this->logFile);
}
/**
@@ -132,7 +137,7 @@ class Factory implements ICacheFactory {
* @return ICache
*/
public function createLocal(string $prefix = ''): ICache {
- return new $this->localCacheClass($this->globalPrefix . '/' . $prefix);
+ return new $this->localCacheClass($this->globalPrefix . '/' . $prefix, $this->logFile);
}
/**