Merge pull request #2975 from owncloud/log-date

use date and time instead of timestamp in log
This commit is contained in:
Morris Jobke 2013-04-17 06:49:46 -07:00
commit 867a527148
3 changed files with 12 additions and 3 deletions

View File

@ -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");

View File

@ -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);
}

View File

@ -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;?>