summaryrefslogtreecommitdiffstats
path: root/lib/private/Log
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Log')
-rw-r--r--lib/private/Log/File.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php
index c881c6dd9de..6810e2598cf 100644
--- a/lib/private/Log/File.php
+++ b/lib/private/Log/File.php
@@ -50,6 +50,8 @@ use OCP\ILogger;
class File implements IWriter, IFileBased {
/** @var string */
protected $logFile;
+ /** @var int */
+ protected $logFileMode;
/** @var SystemConfig */
private $config;
@@ -67,6 +69,7 @@ class File implements IWriter, IFileBased {
}
}
$this->config = $config;
+ $this->logFileMode = $config->getValue('logfilemode', 0640);
}
/**
@@ -134,8 +137,8 @@ class File implements IWriter, IFileBased {
}
$entry = json_encode($entry, JSON_PARTIAL_OUTPUT_ON_ERROR);
$handle = @fopen($this->logFile, 'a');
- if ((fileperms($this->logFile) & 0777) != 0640) {
- @chmod($this->logFile, 0640);
+ if ($this->logFileMode > 0 && (fileperms($this->logFile) & 0777) != $this->logFileMode) {
+ @chmod($this->logFile, $this->logFileMode);
}
if ($handle) {
fwrite($handle, $entry."\n");