src/Jackiedo/LogReader/LogReader.php
public function get()
    {
        $entries = [];

        $files = $this->getLogFiles();

        if (! is_array($files)) {
            throw new UnableToRetrieveLogFilesException('Unable to retrieve files from path: '.$this->getLogPath());
        }

        foreach ($files as $log) {
            /*
             * Set the current log path for easy manipulation
             * of the file if needed
             */
            $this->setCurrentLogPath($log['path']);

            /*
             * Parse the log into an array of entries, passing in the level
             * so it can be filtered
             */
            $parsedLog = $this->parseLog($log['contents'], $this->getEnvironment(), $this->getLevel());

            /*
             * Create a new LogEntry object for each parsed log entry
             */
            foreach ($parsedLog as $entry) {
                $newEntry = new LogEntry($this->parser, $this->cache, $entry);

                /*
                 * Check if the entry has already been read,
                 * and if read entries should be included.
                 *
                 * If includeRead is false, and the entry is read,
                 * then continue processing.
                 */
                if (!$this->includeRead && $newEntry->isRead()) {
                    continue;
                }

                $entries[$newEntry->id] = $newEntry;
            }
        }

        return $this->postCollectionModifiers(new Collection($entries));
    }
public function get()
    {
        $entries = [];

        $files = $this->getLogFiles();

        if (! is_array($files)) {
            throw new UnableToRetrieveLogFilesException('Unable to retrieve files from path: '.$this->getLogPath());
        }

        foreach ($files as $log) {
            /*
             * Set the current log path for easy manipulation
             * of the file if needed
             */
            $this->setCurrentLogPath($log['path']);

            /*
             * Parse the log into an array of entries, passing in the level
             * so it can be filtered
             */
            $parsedLog = $this->parseLog($log['contents'], $this->getEnvironment(), $this->getLevel());

            /*
             * Create a new LogEntry object for each parsed log entry
             */
            foreach ($parsedLog as $entry) {
                $newEntry = new LogEntry($this->parser, $this->cache, $entry);

                /*
                 * Check if the entry has already been read,
                 * and if read entries should be included.
                 *
                 * If includeRead is false, and the entry is read,
                 * then continue processing.
                 */
                if (!$this->includeRead && $newEntry->isRead()) {
                    continue;
                }

                $entries[$newEntry->id] = $newEntry;
            }
        }

        return $this->postCollectionModifiers(new Collection($entries));
    }
public function get ( ) { $ entries = [ ] ; $ files = $ this -> getLogFiles ( ) ; if ( ! is_array ( $ files ) ) { throw new UnableToRetrieveLogFilesException ( 'Unable to retrieve files from path: ' . $ this -> getLogPath ( ) ) ; } foreach ( $ files as $ log ) { /*
             * Set the current log path for easy manipulation
             * of the file if needed
             */ $ this -> setCurrentLogPath ( $ log [ 'path' ] ) ; /*
             * Parse the log into an array of entries, passing in the level
             * so it can be filtered
             */ $ parsedLog = $ this -> parseLog ( $ log [ 'contents' ] , $ this -> getEnvironment ( ) , $ this -> getLevel ( ) ) ; /*
             * Create a new LogEntry object for each parsed log entry
             */ foreach ( $ parsedLog as $ entry ) { $ newEntry = new LogEntry ( $ this -> parser , $ this -> cache , $ entry ) ; /*
                 * Check if the entry has already been read,
                 * and if read entries should be included.
                 *
                 * If includeRead is false, and the entry is read,
                 * then continue processing.
                 */ if ( ! $ this -> includeRead && $ newEntry -> isRead ( ) ) { continue ; } $ entries [ $ newEntry -> id ] = $ newEntry ; } } return $ this -> postCollectionModifiers ( new Collection ( $ entries ) ) ; }
Returns a Laravel collection of log entries.

@throws \Jackiedo\LogReader\Exceptions\UnableToRetrieveLogFilesException

@return Collection
Returns a Laravel collection of log entries .