From dc99442bc16972046522888002ad379c170c138a Mon Sep 17 00:00:00 2001 From: Roland Tapken Date: Fri, 9 Feb 2018 17:30:27 +0100 Subject: [PATCH] External storage test: log exceptions If an external storage test fails the exception's message is now written into the logfile (level INFO). Additionally, the stack trace is printed as DEBUG. This helps to resolve the reason for a failing connection. Signed-off-by: Roland Tapken --- lib/private/Files/Storage/Common.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 56d683ffa2..c9a91a7c56 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -449,8 +449,11 @@ abstract class Common implements Storage, ILockingStorage { if ($this->stat('')) { return true; } + \OC::$server->getLogger()->info("External storage not available: stat() failed"); return false; } catch (\Exception $e) { + \OC::$server->getLogger()->info("External storage not available: " . $e->getMessage()); + \OC::$server->getLogger()->logException($e, ['level' => \OCP\Util::DEBUG]); return false; } }