Skip to content
Permalink
Browse files

Update zigbee2mqtt.class.php

fix view log files
  • Loading branch information...
directman66 committed May 5, 2019
1 parent 4da6750 commit 411899a3cdd72c8b03135fb47432e97178c53ddc
Showing with 11 additions and 1 deletion.
  1. +11 −1 modules/zigbee2mqtt/zigbee2mqtt.class.php
@@ -1312,16 +1312,26 @@ function admin(&$out) {
//$tmp=file_get_contents ($filename, null,null,1000);
if (filesize ($filename)>0) {
$fz=filesize ($filename);
$file = new SplFileObject($filename, 'r');
$file->seek(PHP_INT_MAX);
$last_line = $file->key();
debmes($last_line, 'zg1');
$lines = new LimitIterator($file, $last_line - 500, $last_line);
$max=500;
if ($max>$last_line ) {$max=$last_line;}
$lines = new LimitIterator($file, $last_line - $max, $last_line);
$tmp=(iterator_to_array($lines));
}

0 comments on commit 411899a

Please sign in to comment.
You can’t perform that action at this time.