]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not log locked files 16557/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Fri, 26 Jul 2019 12:29:13 +0000 (14:29 +0200)
committerRoeland Jago Douma <roeland@famdouma.nl>
Fri, 26 Jul 2019 12:29:13 +0000 (14:29 +0200)
This is the code doing its job. There is no need to spam the log file
with this.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/dav/lib/Connector/Sabre/File.php

index f183013f91f679b738b83b73dac7cb2a82d400d3..d336df9830684f738f843803c0af11ff79cab45f 100644 (file)
@@ -55,6 +55,7 @@ use OCP\Files\NotFoundException;
 use OCP\Files\NotPermittedException;
 use OCP\Files\Storage;
 use OCP\Files\StorageNotAvailableException;
+use OCP\ILogger;
 use OCP\Lock\ILockingProvider;
 use OCP\Lock\LockedException;
 use OCP\Share\IManager;
@@ -229,7 +230,13 @@ class File extends Node implements IFile {
                        }
 
                } catch (\Exception $e) {
-                       \OC::$server->getLogger()->logException($e);
+                       $context = [];
+
+                       if ($e instanceof LockedException) {
+                               $context['level'] = ILogger::DEBUG;
+                       }
+
+                       \OC::$server->getLogger()->logException($e, $context);
                        if ($needsPartFile) {
                                $partStorage->unlink($internalPartPath);
                        }