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 <roland@bitarbeiter.net>
This commit is contained in:
Roland Tapken 2018-02-09 17:30:27 +01:00
parent ee77f37df2
commit dc99442bc1
1 changed files with 3 additions and 0 deletions

View File

@ -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;
}
}