From f5c3a346b00b7c8e4926b898f6e6ade86de74c73 Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 2 Aug 2013 13:34:20 +0200 Subject: make log date configurable, default to iso 8601 --- lib/log/owncloud.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php index 7a11a588330..e7246726d40 100644 --- a/lib/log/owncloud.php +++ b/lib/log/owncloud.php @@ -49,7 +49,9 @@ class OC_Log_Owncloud { public static function write($app, $message, $level) { $minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR); if($level>=$minLevel) { - $time = date("F d, Y H:i:s", time()); + // default to ISO8601 + $format = OC_Config::getValue('logdateformat', 'c'); + $time = date($format, time()); $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time); $handle = @fopen(self::$logFile, 'a'); if ($handle) { -- cgit v1.2.3 From ad952f215d18f3f06ac54118ee55eb4f2d5da777 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Sun, 4 Aug 2013 23:13:19 +0200 Subject: add 'logdateformat' to config.sample.php --- config/config.sample.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/config.sample.php b/config/config.sample.php index 8d978ea6ee7..75c600a7c3e 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -185,5 +185,8 @@ $CONFIG = array( //links to custom clients 'customclient_desktop' => '', //http://owncloud.org/sync-clients/ 'customclient_android' => '', //https://play.google.com/store/apps/details?id=com.owncloud.android -'customclient_ios' => '' //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8 +'customclient_ios' => '', //https://itunes.apple.com/us/app/owncloud/id543672169?mt=8 + +// date format to be used while writing to the owncloud logfile +'logdateformat' => 'F d, Y H:i:s' ); -- cgit v1.2.3 From 33d78ab9c719ac0677651cfe76bf6a2aa3073241 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Sun, 4 Aug 2013 23:13:34 +0200 Subject: fixing PHPDoc --- lib/log/owncloud.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php index e7246726d40..d16b9537a16 100644 --- a/lib/log/owncloud.php +++ b/lib/log/owncloud.php @@ -44,7 +44,7 @@ class OC_Log_Owncloud { * write a message in the log * @param string $app * @param string $message - * @param int level + * @param int $level */ public static function write($app, $message, $level) { $minLevel=min(OC_Config::getValue( "loglevel", OC_Log::WARN ), OC_Log::ERROR); @@ -63,8 +63,8 @@ class OC_Log_Owncloud { /** * get entries from the log in reverse chronological order - * @param int limit - * @param int offset + * @param int $limit + * @param int $offset * @return array */ public static function getEntries($limit=50, $offset=0) { -- cgit v1.2.3