Merge pull request #1647 from nextcloud/stable9-backport-1562
[stable9] log version number in each log line
This commit is contained in:
commit
2f546eab71
|
@ -91,11 +91,12 @@ class OC_Log_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',
|
||||||
|
@ -105,7 +106,8 @@ class OC_Log_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');
|
||||||
|
|
Loading…
Reference in New Issue