parent
cf232c4182
commit
e2c557ab82
|
@ -76,9 +76,12 @@ class OC_Log_Owncloud {
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$timezone = new DateTimeZone('UTC');
|
$timezone = new DateTimeZone('UTC');
|
||||||
}
|
}
|
||||||
$time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", ""), $timezone);
|
$time = DateTime::createFromFormat("U.u", number_format(microtime(true), 4, ".", ""));
|
||||||
if ($time === false) {
|
if ($time === false) {
|
||||||
$time = new DateTime(null, $timezone);
|
$time = new DateTime(null, $timezone);
|
||||||
|
} else {
|
||||||
|
// apply timezone if $time is created from UNIX timestamp
|
||||||
|
$time->setTimezone($timezone);
|
||||||
}
|
}
|
||||||
$request = \OC::$server->getRequest();
|
$request = \OC::$server->getRequest();
|
||||||
$reqId = $request->getId();
|
$reqId = $request->getId();
|
||||||
|
@ -90,8 +93,7 @@ class OC_Log_Owncloud {
|
||||||
$url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '--';
|
$url = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '--';
|
||||||
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '--';
|
$method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : '--';
|
||||||
$entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time', 'method', 'url');
|
$entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time', 'method', 'url');
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time');
|
$entry = compact('reqId', 'remoteAddr', 'app', 'message', 'level', 'time');
|
||||||
}
|
}
|
||||||
$entry = json_encode($entry);
|
$entry = json_encode($entry);
|
||||||
|
|
Loading…
Reference in New Issue