summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-01-27 07:48:40 -0800
committerThomas Müller <thomas.mueller@tmit.eu>2014-01-27 07:48:40 -0800
commitab9ddda8f2a969d5c4d8c831de34d60d4ade5648 (patch)
tree68ef4ac614494c5b0fae07ff2d58e00e10cbafc0 /lib/public/util.php
parent25305a535b37dfb8a64ef9565e303c87e5d46ca0 (diff)
parent11ef12a1060f3e34312ae40c690f95765d7c5f89 (diff)
downloadnextcloud-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.php8
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) {