diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index 4c7ef446a0..8011f63ab1 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -119,7 +119,9 @@ class File { ); $entry = json_encode($entry); $handle = @fopen(self::$logFile, 'a'); - @chmod(self::$logFile, 0640); + if ((fileperms(self::$logFile) & 0777) != 0640) { + @chmod(self::$logFile, 0640); + } if ($handle) { fwrite($handle, $entry."\n"); fclose($handle);