fix default value for logdateformat - fixes #3107
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
48a3f2a8a2
commit
2316083256
|
@ -716,7 +716,7 @@ $CONFIG = array(
|
||||||
/**
|
/**
|
||||||
* This uses PHP.date formatting; see http://php.net/manual/en/function.date.php
|
* This uses PHP.date formatting; see http://php.net/manual/en/function.date.php
|
||||||
*
|
*
|
||||||
* Defaults to ``Y-m-d\TH:i:sO`` (ISO8601)
|
* Defaults to ``Y-m-d\TH:i:sO`` (ISO8601) - see \DateTime::ISO8601
|
||||||
*/
|
*/
|
||||||
'logdateformat' => 'F d, Y H:i:s',
|
'logdateformat' => 'F d, Y H:i:s',
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ class TimestampFormatter implements OutputFormatterInterface {
|
||||||
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;
|
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;
|
||||||
|
|
||||||
$time = new \DateTime('now', $timeZone);
|
$time = new \DateTime('now', $timeZone);
|
||||||
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', 'c'));
|
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ISO8601));
|
||||||
|
|
||||||
return $timestampInfo . ' ' . $this->formatter->format($message);
|
return $timestampInfo . ' ' . $this->formatter->format($message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,8 +75,8 @@ class File {
|
||||||
$config = \OC::$server->getSystemConfig();
|
$config = \OC::$server->getSystemConfig();
|
||||||
|
|
||||||
// default to ISO8601
|
// default to ISO8601
|
||||||
$format = $config->getValue('logdateformat', 'c');
|
$format = $config->getValue('logdateformat', \DateTime::ISO8601);
|
||||||
$logTimeZone = $config->getValue( "logtimezone", 'UTC' );
|
$logTimeZone = $config->getValue('logtimezone', 'UTC');
|
||||||
try {
|
try {
|
||||||
$timezone = new \DateTimeZone($logTimeZone);
|
$timezone = new \DateTimeZone($logTimeZone);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
Loading…
Reference in New Issue