diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-27 07:48:40 -0800 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-01-27 07:48:40 -0800 |
commit | ab9ddda8f2a969d5c4d8c831de34d60d4ade5648 (patch) | |
tree | 68ef4ac614494c5b0fae07ff2d58e00e10cbafc0 /lib/public/util.php | |
parent | 25305a535b37dfb8a64ef9565e303c87e5d46ca0 (diff) | |
parent | 11ef12a1060f3e34312ae40c690f95765d7c5f89 (diff) | |
download | nextcloud-server-ab9ddda8f2a969d5c4d8c831de34d60d4ade5648.tar.gz nextcloud-server-ab9ddda8f2a969d5c4d8c831de34d60d4ade5648.zip |
Merge pull request #6907 from owncloud/webdav-logexceptions
Added exception logger plugin for sabre connector
Diffstat (limited to 'lib/public/util.php')
-rw-r--r-- | lib/public/util.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/public/util.php b/lib/public/util.php index 6317f10a66f..26c5a15cff2 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -88,14 +88,18 @@ class Util { * @param Exception $ex exception to log */ public static function logException( $app, \Exception $ex ) { - $message = $ex->getMessage(); + $class = get_class($ex); + if ($class !== 'Exception') { + $message = $class . ': '; + } + $message .= $ex->getMessage(); if ($ex->getCode()) { $message .= ' [' . $ex->getCode() . ']'; } \OCP\Util::writeLog($app, 'Exception: ' . $message, \OCP\Util::FATAL); if (defined('DEBUG') and DEBUG) { // also log stack trace - $stack = explode('#', $ex->getTraceAsString()); + $stack = explode("\n", $ex->getTraceAsString()); // first element is empty array_shift($stack); foreach ($stack as $s) { |