Logging/src/Logger.php
public function entries(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);
        $logNameFilter = "logName = $this->formattedName";
        $options += [
            'resourceNames' => ["projects/$this->projectId"],
            'filter' => isset($options['filter'])
                ? $options['filter'] .= " AND $logNameFilter"
                : $logNameFilter
        ];

        return new ItemIterator(
            new PageIterator(
                function (array $entry) {
                    return new Entry($entry);
                },
                [$this->connection, 'listEntries'],
                $options,
                [
                    'itemsKey' => 'entries',
                    'resultLimit' => $resultLimit
                ]
            )
        );
    }
public function entries(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);
        $logNameFilter = "logName = $this->formattedName";
        $options += [
            'resourceNames' => ["projects/$this->projectId"],
            'filter' => isset($options['filter'])
                ? $options['filter'] .= " AND $logNameFilter"
                : $logNameFilter
        ];

        return new ItemIterator(
            new PageIterator(
                function (array $entry) {
                    return new Entry($entry);
                },
                [$this->connection, 'listEntries'],
                $options,
                [
                    'itemsKey' => 'entries',
                    'resultLimit' => $resultLimit
                ]
            )
        );
    }
public function entries ( array $ options = [ ] ) { $ resultLimit = $ this -> pluck ( 'resultLimit' , $ options , false ) ; $ logNameFilter = "logName = $this->formattedName" ; $ options += [ 'resourceNames' => [ "projects/$this->projectId" ] , 'filter' => isset ( $ options [ 'filter' ] ) ? $ options [ 'filter' ] .= " AND $logNameFilter" : $ logNameFilter ] ; return new ItemIterator ( new PageIterator ( function ( array $ entry ) { return new Entry ( $ entry ) ; } , [ $ this -> connection , 'listEntries' ] , $ options , [ 'itemsKey' => 'entries' , 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches entries scoped to the selected log.

Please note that a default filter specifying the logName will be applied
for you.

Example:
```
$entries = $logger->entries();

foreach ($entries as $entry) {
echo $entry->info()['textPayload'] . PHP_EOL;
}
```

```
// Use an advanced logs filter to fetch only entries with a specific payload.
$entries = $logger->entries([
'filter' => 'textPayload = "hello world"'
]);

foreach ($entries as $entry) {
echo $entry->info()['textPayload'] . PHP_EOL;
}
```

@codingStandardsIgnoreStart
@see https://cloud.google.com/logging/docs/api/reference/rest/v2/entries/list Entries list API documentation.
@codingStandardsIgnoreEnd

@param array $options [optional] {
Configuration options.

@type string $filter An [advanced logs filter](https://cloud.google.com/logging/docs/view/advanced_filters).
@type string $orderBy How the results should be sorted. Presently,
the only permitted values are `timestamp asc` and `timestamp desc`.
**Defaults to** `"timestamp asc"`.
@type int $pageSize The maximum number of results to return per
request.
@type int $resultLimit Limit the number of results returned in total.
**Defaults to** `0` (return all results).
@type string $pageToken A previously-returned page token used to
resume the loading of results from a specific point.
}
@return ItemIterator<Entry>
Fetches entries scoped to the selected log .