log version number in each log line

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2016-09-28 16:45:14 +02:00
parent 04d0daed12
commit 6374593099
1 changed files with 4 additions and 2 deletions

View File

@ -96,11 +96,12 @@ class Owncloud {
$time = $time->format($format); $time = $time->format($format);
$url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--'; $url = ($request->getRequestUri() !== '') ? $request->getRequestUri() : '--';
$method = is_string($request->getMethod()) ? $request->getMethod() : '--'; $method = is_string($request->getMethod()) ? $request->getMethod() : '--';
if(\OC::$server->getConfig()->getSystemValue('installed', false)) { if($config->getValue('installed', false)) {
$user = (\OC_User::getUser()) ? \OC_User::getUser() : '--'; $user = (\OC_User::getUser()) ? \OC_User::getUser() : '--';
} else { } else {
$user = '--'; $user = '--';
} }
$version = $config->getValue('version', '');
$entry = compact( $entry = compact(
'reqId', 'reqId',
'remoteAddr', 'remoteAddr',
@ -110,7 +111,8 @@ class Owncloud {
'time', 'time',
'method', 'method',
'url', 'url',
'user' 'user',
'version'
); );
$entry = json_encode($entry); $entry = json_encode($entry);
$handle = @fopen(self::$logFile, 'a'); $handle = @fopen(self::$logFile, 'a');