diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2018-01-23 11:56:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-23 11:56:02 +0100 |
commit | 4537faa5dabdcb2f0b888baa5031e59099e52d6a (patch) | |
tree | 0295177ddd5f6736739c503131eb75323561b220 /settings | |
parent | 9cb3a79b18bb74e3f79d53aa400d7efa5b2c2174 (diff) | |
parent | 2a38605545e26ce68a37e5ebb877fd9c9875a37d (diff) | |
download | nextcloud-server-4537faa5dabdcb2f0b888baa5031e59099e52d6a.tar.gz nextcloud-server-4537faa5dabdcb2f0b888baa5031e59099e52d6a.zip |
Merge pull request #7918 from nextcloud/properly-log-exceptions
Properly log the full exception instead of only the message
Diffstat (limited to 'settings')
-rw-r--r-- | settings/Controller/UsersController.php | 6 | ||||
-rw-r--r-- | settings/ajax/enableapp.php | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php index 53ffd62a06d..af5aff8371d 100644 --- a/settings/Controller/UsersController.php +++ b/settings/Controller/UsersController.php @@ -487,7 +487,11 @@ class UsersController extends Controller { $emailTemplate = $this->newUserMailHelper->generateTemplate($user, $generatePasswordResetToken); $this->newUserMailHelper->sendMail($user, $emailTemplate); } catch (\Exception $e) { - $this->log->error("Can't send new user mail to $email: " . $e->getMessage(), ['app' => 'settings']); + $this->log->logException($e, [ + 'message' => "Can't send new user mail to $email", + 'level' => \OCP\Util::ERROR, + 'app' => 'settings', + ]); } } // fetch users groups diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php index 3d2d7f95a5e..4014664481a 100644 --- a/settings/ajax/enableapp.php +++ b/settings/ajax/enableapp.php @@ -50,6 +50,9 @@ try { OC_JSON::success(['data' => ['update_required' => $updateRequired]]); } catch (Exception $e) { - \OCP\Util::writeLog('core', $e->getMessage(), \OCP\Util::ERROR); + \OC::$server->getLogger()->logException($e, [ + 'level' => \OCP\Util::DEBUG, + 'app' => 'core', + ]); OC_JSON::error(array("data" => array("message" => $e->getMessage()) )); } |