aws/aws-sdk-php — pull request #186 by jeremeamia (2013-11-27 19:53:55+00:00)
Title: Adds an AWS CloudTrail LogRecordsIterator for reading logs

The `Aws\CloudTrail\LogRecordsIterator` class allows you to iterate over log records from the log files stored in Amazon S3 that are generated by the AWS CloudTrail service.

*Note:* The feature is not quite finished yet, and I still need to write the tests. I am creating this PR now to provide a preview of the feature and to get feedback.

#### Usage Example

```php
$records = $cloudTrailClient->getLogRecordsIterator(array(
'AccountID' => '############',
'LogRegion' => 'us-east-1',
'StartDate' => '-1 week',
));
// Other options include: 'TrailName', 'EndDate', 'S3BucketName', 'S3KeyPrefix', 'S3Client'.
// If 'TrailName' is not provided, it is assumed to be "Default", which is what the AWS Console creates.
// If 'S3Client' is not provided, an instance is created from the credentials of the CloudTrailClient being used.

foreach ($records as $record) {
printf(
"The %s operation for %s was executed at %s.\n",
$record['eventName'],
$record['eventSource'],
$record['eventTime']
);
}
```
```
The CreateTrail operation for cloudtrail.amazonaws.com was executed at 2013-11-22T19:19:16Z.
The StartLogging operation for cloudtrail.amazonaws.com was executed at 2013-11-22T19:19:16Z.
The DescribeTrails operation for cloudtrail.amazonaws.com was executed at 2013-11-22T19:19:15Z.
The DescribeInstances operation for ec2.amazonaws.com was executed at 2013-11-22T19:22:17Z.
The GetSessionToken operation for sts.amazonaws.com was executed at 2013-11-22T19:28:29Z.
```