summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-29 11:43:32 +0200
committerJoas Schilling <coding@schilljs.com>2017-06-29 17:20:10 +0200
commitb27819785e32be24f289958efda79dec6358da00 (patch)
treec811068bdf65550d74b53be0ef80a19693f9f146 /apps/dav/lib
parent045d04332e00acbe28adbad54e4b9c5ce8486d38 (diff)
downloadnextcloud-server-b27819785e32be24f289958efda79dec6358da00.tar.gz
nextcloud-server-b27819785e32be24f289958efda79dec6358da00.zip
Don't log passwords on dav exceptions
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php25
1 files changed, 4 insertions, 21 deletions
diff --git a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
index 4f7c2286827..dce2f9c45e4 100644
--- a/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
+++ b/apps/dav/lib/Connector/Sabre/ExceptionLoggerPlugin.php
@@ -94,26 +94,9 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin {
$level = \OCP\Util::DEBUG;
}
- $message = $ex->getMessage();
- if ($ex instanceof Exception) {
- if (empty($message)) {
- $response = new Response($ex->getHTTPCode());
- $message = $response->getStatusText();
- }
- $message = "HTTP/1.1 {$ex->getHTTPCode()} $message";
- }
-
- $user = \OC_User::getUser();
-
- $exception = [
- 'Message' => $message,
- 'Exception' => $exceptionClass,
- 'Code' => $ex->getCode(),
- 'Trace' => $ex->getTraceAsString(),
- 'File' => $ex->getFile(),
- 'Line' => $ex->getLine(),
- 'User' => $user,
- ];
- $this->logger->log($level, 'Exception: ' . json_encode($exception), ['app' => $this->appName]);
+ $this->logger->logException($ex, [
+ 'app' => $this->appName,
+ 'level' => $level,
+ ]);
}
}