Merge pull request #2975 from owncloud/log-date
use date and time instead of timestamp in log
This commit is contained in:
commit
867a527148
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;?>
|
||||
|
|
Loading…
Reference in New Issue