Commit 867a5271 authored by Morris Jobke's avatar Morris Jobke
Browse files

Merge pull request #2975 from owncloud/log-date

use date and time instead of timestamp in log
parents ec280e6f 4679e789
......@@ -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;?>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment