From 231608325691be8e9e9f046897c12982da3c4eb3 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 19 Jan 2017 20:08:15 -0600 Subject: [PATCH] fix default value for logdateformat - fixes #3107 Signed-off-by: Morris Jobke --- config/config.sample.php | 2 +- lib/private/Console/TimestampFormatter.php | 2 +- lib/private/Log/File.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index 534af5a3a3..c6960ec320 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -716,7 +716,7 @@ $CONFIG = array( /** * 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', diff --git a/lib/private/Console/TimestampFormatter.php b/lib/private/Console/TimestampFormatter.php index 5b292439a4..d68db95f64 100644 --- a/lib/private/Console/TimestampFormatter.php +++ b/lib/private/Console/TimestampFormatter.php @@ -101,7 +101,7 @@ class TimestampFormatter implements OutputFormatterInterface { $timeZone = $timeZone !== null ? new \DateTimeZone($timeZone) : null; $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); } diff --git a/lib/private/Log/File.php b/lib/private/Log/File.php index 904aa1d93f..d41ab83c80 100644 --- a/lib/private/Log/File.php +++ b/lib/private/Log/File.php @@ -75,8 +75,8 @@ class File { $config = \OC::$server->getSystemConfig(); // default to ISO8601 - $format = $config->getValue('logdateformat', 'c'); - $logTimeZone = $config->getValue( "logtimezone", 'UTC' ); + $format = $config->getValue('logdateformat', \DateTime::ISO8601); + $logTimeZone = $config->getValue('logtimezone', 'UTC'); try { $timezone = new \DateTimeZone($logTimeZone); } catch (\Exception $e) {