Skip to content

Commit

Permalink
Display .log files only in sidebar (#96)
Browse files Browse the repository at this point in the history
Only show .log files.
  • Loading branch information
cino authored and rap2hpoutre committed Jun 27, 2017
1 parent 1bab6d8 commit 29a5a36
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
namespace Rap2hpoutre\LaravelLogViewer;

use Psr\Log\LogLevel;
use ReflectionClass;

/**
* Class LaravelLogViewer
* @package Rap2hpoutre\LaravelLogViewer
*/
class LaravelLogViewer
{

/**
* @var string file
*/
Expand Down Expand Up @@ -56,7 +54,6 @@ class LaravelLogViewer
'processed'
];


const MAX_FILE_SIZE = 52428800; // Why? Uh... Sorry

/**
Expand All @@ -72,7 +69,7 @@ public static function setFile($file)
}

/**
* @param $file
* @param string $file
* @return string
* @throws \Exception
*/
Expand Down Expand Up @@ -165,7 +162,7 @@ public static function all()
*/
public static function getFiles($basename = false)
{
$files = glob(storage_path() . '/logs/*');
$files = glob(storage_path() . '/logs/*.log');
$files = array_reverse($files);
$files = array_filter($files, 'is_file');
if ($basename && is_array($files)) {
Expand Down

0 comments on commit 29a5a36

Please sign in to comment.