Logging/src/LoggingClient.php
public function entries(array $options = [])
    {
        $resultLimit = $this->pluck('resultLimit', $options, false);
        $resourceNames = ['projects/' . $this->projectId];
        if (isset($options['projectIds'])) {
            foreach ($options['projectIds'] as $projectId) {
                  $resourceNames[] = 'projects/' . $projectId;
            }
            unset($options['projectIds']);
        }
        if (isset($options['resourceNames'])) {
            $options['resourceNames'] = array_merge($resourceNames, $options['projectIds']);
        } else {
            $options['resourceNames'] = $resourceNames;
        }

        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);
        $resourceNames = ['projects/' . $this->projectId];
        if (isset($options['projectIds'])) {
            foreach ($options['projectIds'] as $projectId) {
                  $resourceNames[] = 'projects/' . $projectId;
            }
            unset($options['projectIds']);
        }
        if (isset($options['resourceNames'])) {
            $options['resourceNames'] = array_merge($resourceNames, $options['projectIds']);
        } else {
            $options['resourceNames'] = $resourceNames;
        }

        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 ) ; $ resourceNames = [ 'projects/' . $ this -> projectId ] ; if ( isset ( $ options [ 'projectIds' ] ) ) { foreach ( $ options [ 'projectIds' ] as $ projectId ) { $ resourceNames [ ] = 'projects/' . $ projectId ; } unset ( $ options [ 'projectIds' ] ) ; } if ( isset ( $ options [ 'resourceNames' ] ) ) { $ options [ 'resourceNames' ] = array_merge ( $ resourceNames , $ options [ 'projectIds' ] ) ; } else { $ options [ 'resourceNames' ] = $ resourceNames ; } return new ItemIterator ( new PageIterator ( function ( array $ entry ) { return new Entry ( $ entry ) ; } , [ $ this -> connection , 'listEntries' ] , $ options , [ 'itemsKey' => 'entries' , 'resultLimit' => $ resultLimit ] ) ) ; }
Fetches log entries.

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

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

```
// Use an advanced logs filter to fetch only entries from a specified log.
$entries = $logging->entries([
'filter' => 'logName = projects/my-project/logs/my-log'
]);

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[] $projectIds A list of projectIds to fetch
entries from in addition to entries found in the project bound
to this client.
@type string[] $resourceNames One or more cloud resources from which
to retrieve log entries. Projects listed in projectIds are
added to this list.
Example: "projects/my-project-1A", "projects/1234567890".
@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 log entries .