summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-04-17 06:49:46 -0700
committerMorris Jobke <morris.jobke@gmail.com>2013-04-17 06:49:46 -0700
commit867a52714853815da04ef8c43f70deaa2d6b55ee (patch)
treee3072fcfc13c703288b5feb8c8afa1dc2fdaf9fe
parentec280e6f9f43e2f1d74c9ddf1e0fd64aabddc25f (diff)
parent4679e789e1bd1c485f2c7f74af8d20bcaff1e44f (diff)
downloadnextcloud-server-867a52714853815da04ef8c43f70deaa2d6b55ee.tar.gz
nextcloud-server-867a52714853815da04ef8c43f70deaa2d6b55ee.zip
Merge pull request #2975 from owncloud/log-date
use date and time instead of timestamp in log
-rw-r--r--lib/log/owncloud.php3
-rw-r--r--settings/js/log.js6
-rw-r--r--settings/templates/admin.php6
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/log/owncloud.php b/lib/log/owncloud.php
index 20df52c27bb..7a11a588330 100644
--- a/lib/log/owncloud.php
+++ b/lib/log/owncloud.php
@@ -49,7 +49,8 @@ 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) {
- $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=>time());
+ $time = date("F d, Y H:i:s", time());
+ $entry=array('app'=>$app, 'message'=>$message, 'level'=>$level, 'time'=> $time);
$handle = @fopen(self::$logFile, 'a');
if ($handle) {
fwrite($handle, json_encode($entry)."\n");
diff --git a/settings/js/log.js b/settings/js/log.js
index 81117f9e827..84f6d1aa5f3 100644
--- a/settings/js/log.js
+++ b/settings/js/log.js
@@ -55,7 +55,11 @@ OC.Log={
row.append(messageTd);
var timeTd=$('<td/>');
- timeTd.text(formatDate(entry.time*1000));
+ if(isNaN(entry.time)){
+ timeTd.text(entry.time);
+ } else {
+ timeTd.text(formatDate(entry.time*1000));
+ }
row.append(timeTd);
$('#log').append(row);
}
diff --git a/settings/templates/admin.php b/settings/templates/admin.php
index fdaba95ac17..182168ce9eb 100644
--- a/settings/templates/admin.php
+++ b/settings/templates/admin.php
@@ -214,7 +214,11 @@ endfor;?>
<?php p($entry->message);?>
</td>
<td>
- <?php p(OC_Util::formatDate($entry->time));?>
+ <?php if(is_int($entry->time)){
+ p(OC_Util::formatDate($entry->time));
+ } else {
+ p($entry->time);
+ }?>
</td>
</tr>
<?php endforeach;?>