diff options
Diffstat (limited to 'apps/files_external/lib/Service/StoragesService.php')
-rw-r--r-- | apps/files_external/lib/Service/StoragesService.php | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/apps/files_external/lib/Service/StoragesService.php b/apps/files_external/lib/Service/StoragesService.php index d52bf410461..89458b70c0c 100644 --- a/apps/files_external/lib/Service/StoragesService.php +++ b/apps/files_external/lib/Service/StoragesService.php @@ -102,18 +102,18 @@ abstract class StoragesService { return $config; } catch (\UnexpectedValueException $e) { // don't die if a storage backend doesn't exist - \OCP\Util::writeLog( - 'files_external', - 'Could not load storage: "' . $e->getMessage() . '"', - \OCP\Util::ERROR - ); + \OC::$server->getLogger()->logException($e, [ + 'message' => 'Could not load storage.', + 'level' => \OCP\Util::ERROR, + 'app' => 'files_external', + ]); return null; } catch (\InvalidArgumentException $e) { - \OCP\Util::writeLog( - 'files_external', - 'Could not load storage: "' . $e->getMessage() . '"', - \OCP\Util::ERROR - ); + \OC::$server->getLogger()->logException($e, [ + 'message' => 'Could not load storage.', + 'level' => \OCP\Util::ERROR, + 'app' => 'files_external', + ]); return null; } } @@ -478,11 +478,10 @@ abstract class StoragesService { // can happen either for invalid configs where the storage could not // be instantiated or whenever $user vars where used, in which case // the storage id could not be computed - \OCP\Util::writeLog( - 'files_external', - 'Exception: "' . $e->getMessage() . '"', - \OCP\Util::ERROR - ); + \OC::$server->getLogger()->logException($e, [ + 'level' => \OCP\Util::ERROR, + 'app' => 'files_external', + ]); } } |