Enabling logs
To enable logging, confirm the prerequisites, and then set up delivery in the console or with the CloudWatch Logs API.
Prerequisites
Elemental Inference uses CloudWatch Logs vended logs to deliver application logs for each feed. To enable logging, you will need permissions to the log destination that you specify. To see the required permissions for each choice of logging destination, view the corresponding pages in the Amazon CloudWatch Logs User Guide:
In addition, your IAM user or role must include the
elemental-inference:AllowVendedLogDeliveryForResource permission for any feed you
would like to receive logs for. See the following example to grant permissions for any
feed.
To set up log delivery in the console, ensure that you have additional Console-specific permissions. For more information about the permissions to manage log delivery, see Logging that requires additional permissions.
Supported log types
Elemental Inference supports the following log type:
-
APPLICATION_LOGS: Records processing activity for a feed at theINFO,WARN, andERRORlevels. Use these logs to troubleshoot a feed and monitor its health.
Using the console
To enable logging using the console
-
Open the Elemental Inference console
. -
Create a feed, or open the details page of an existing feed. For instructions on creating a feed, see Step A: Create the feed in Elemental Inference. For instructions on working with an existing feed, see Work with existing Elemental Inference feeds.
-
On the feed details page, choose the Log delivery tab. Add a log delivery, and set the following:
-
The logging destination: CloudWatch Logs, Amazon S3, or Firehose.
-
The destination resource: a log group for CloudWatch Logs, a bucket for Amazon S3, or a stream for Firehose.
-
-
Verify that the log delivery appears under the Log delivery tab on the feed details page.
After delivery is active, you can view recent feed logs on the Monitoring tab of the feed details page. For more information, see Monitoring tab.
To view recent feed logs in the console, you must set up at least one log delivery to CloudWatch Logs.
Using the CloudWatch Logs API
In CloudWatch Logs, you create three elements to represent the pieces of log delivery. For more information about these elements, see CreateDelivery in the Amazon CloudWatch Logs API Reference.
To enable logging using the CloudWatch Logs API
-
Get the Amazon Resource Name (ARN) of your feed. A feed ARN uses the format
arn:aws:elemental-inference:.region:account-id:feed/feed-id -
Call PutDeliverySource to create a delivery source for the feed. Pass the feed ARN as the
resourceArn, and setlogTypetoAPPLICATION_LOGS.{ "name": "my-feed-delivery-source", "resourceArn": "arn:aws:elemental-inference:us-west-2:111122223333:feed/abc123example", "logType": "APPLICATION_LOGS" } -
Call PutDeliveryDestination to configure where to store the logs. Choose CloudWatch Logs, Amazon S3, or Firehose, and specify the ARN of that destination.
To deliver logs to another account, use PutDeliveryDestinationPolicy in the destination account. This policy grants delivery from the source account.
-
Call CreateDelivery to link the delivery source to the delivery destination.
-
To confirm that delivery is set up, call ListDeliveries and verify that your delivery appears in the results.