From 167a8d72cf347f2555bb8a7f770032b40fefc732 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 26 Jul 2019 14:29:13 +0200 Subject: [PATCH] Do not log locked files This is the code doing its job. There is no need to spam the log file with this. Signed-off-by: Roeland Jago Douma --- apps/dav/lib/Connector/Sabre/File.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/dav/lib/Connector/Sabre/File.php b/apps/dav/lib/Connector/Sabre/File.php index 9815059c59..0767fc9550 100644 --- a/apps/dav/lib/Connector/Sabre/File.php +++ b/apps/dav/lib/Connector/Sabre/File.php @@ -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); }