Browse Source

Merge pull request #3321 from nextcloud/revert-unintentional-change-of-log-timestamp-format

Revert unintentional log timestamp format change
tags/v12.0.0beta1
Morris Jobke 7 years ago
parent
commit
db5af891c3

+ 2
- 3
config/config.sample.php View File

@@ -716,9 +716,8 @@ $CONFIG = array(
/**
* This uses PHP.date formatting; see http://php.net/manual/en/function.date.php
*
* Defaults to ``Y-m-d\TH:i:sP`` (ISO8601 but with colon between hours and
* minutes of the timezone) - see \DateTime::ISO8601
* (https://secure.php.net/manual/en/class.datetime.php#datetime.constants.iso8601)
* Defaults to ISO 8601 ``2005-08-15T15:52:01+00:00`` - see \DateTime::ATOM
* (https://secure.php.net/manual/en/class.datetime.php#datetime.constants.atom)
*/
'logdateformat' => 'F d, Y H:i:s',


+ 2
- 2
lib/private/Console/TimestampFormatter.php View File

@@ -97,11 +97,11 @@ class TimestampFormatter implements OutputFormatterInterface {
*/
public function format($message) {

$timeZone = $this->config->getSystemValue('logtimezone', null);
$timeZone = $this->config->getSystemValue('logtimezone', 'UTC');
$timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null;

$time = new \DateTime('now', $timeZone);
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ISO8601));
$timestampInfo = $time->format($this->config->getSystemValue('logdateformat', \DateTime::ATOM));

return $timestampInfo . ' ' . $this->formatter->format($message);
}

+ 1
- 1
lib/private/Log/File.php View File

@@ -75,7 +75,7 @@ class File {
$config = \OC::$server->getSystemConfig();

// default to ISO8601
$format = $config->getValue('logdateformat', \DateTime::ISO8601);
$format = $config->getValue('logdateformat', \DateTime::ATOM);
$logTimeZone = $config->getValue('logtimezone', 'UTC');
try {
$timezone = new \DateTimeZone($logTimeZone);

Loading…
Cancel
Save