diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-01-31 08:44:06 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-31 08:44:06 -0600 |
commit | db5af891c3c9536faf1f0a62374459242bfeedaf (patch) | |
tree | d251498ba7300737d324787d1213535bbda9e760 | |
parent | 5bad417e57231e129b7113ebb110b1f2b282f349 (diff) | |
parent | 2a6006b9275d0c968deff371768b3e21856c5b38 (diff) | |
download | nextcloud-server-db5af891c3c9536faf1f0a62374459242bfeedaf.tar.gz nextcloud-server-db5af891c3c9536faf1f0a62374459242bfeedaf.zip |
Merge pull request #3321 from nextcloud/revert-unintentional-change-of-log-timestamp-format
Revert unintentional log timestamp format change
-rw-r--r-- | config/config.sample.php | 5 | ||||
-rw-r--r-- | lib/private/Console/TimestampFormatter.php | 4 | ||||
-rw-r--r-- | lib/private/Log/File.php | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/config/config.sample.php b/config/config.sample.php index a9ab67374f8..3d1829e17e6 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -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', diff --git a/lib/private/Console/TimestampFormatter.php b/lib/private/Console/TimestampFormatter.php index d68db95f645..66dd38e6ac3 100644 --- a/lib/private/Console/TimestampFormatter.php +++ b/lib/private/Console/TimestampFormatter.php @@ -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); } diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index d41ab83c804..be8b72b3a3f 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -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); |