diff --git a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php index 5262a55..3077f87 100644 --- a/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php +++ b/src/Rap2hpoutre/LaravelLogViewer/LaravelLogViewer.php @@ -155,6 +155,16 @@ public function all() return null; } + if (!is_readable($this->file)) { + return [[ + 'context' => '', + 'level' => '', + 'date' => null, + 'text' => 'Log file "' . $this->file . '" not readable', + 'stack' => '', + ]]; + } + $file = app('files')->get($this->file); preg_match_all($this->pattern->getPattern('logs'), $file, $headings);