From 1a8a667863bcf2213190f30e862116f4304ef4a5 Mon Sep 17 00:00:00 2001 From: Pierre Jochem Date: Thu, 22 Oct 2015 15:46:33 +0200 Subject: [PATCH] Solution for Proposal #19974 Show username when writing into owncloud.log --- apps/dav/lib/connector/sabre/exceptionloggerplugin.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/dav/lib/connector/sabre/exceptionloggerplugin.php b/apps/dav/lib/connector/sabre/exceptionloggerplugin.php index b514a917556..1052c56e968 100644 --- a/apps/dav/lib/connector/sabre/exceptionloggerplugin.php +++ b/apps/dav/lib/connector/sabre/exceptionloggerplugin.php @@ -94,6 +94,8 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { $message = "HTTP/1.1 {$ex->getHTTPCode()} $message"; } + $user = \OC_User::getUser(); + $exception = [ 'Message' => $message, 'Exception' => $exceptionClass, @@ -101,6 +103,7 @@ class ExceptionLoggerPlugin extends \Sabre\DAV\ServerPlugin { 'Trace' => $ex->getTraceAsString(), 'File' => $ex->getFile(), 'Line' => $ex->getLine(), + 'User' => $user, ]; $this->logger->log($level, 'Exception: ' . json_encode($exception), ['app' => $this->appName]); } -- 2.39.5