Integrating with CloudWatch Logs
To enable integration with CloudWatch Logs, there are two steps:
Enable trace to logs correlation. This is supported only using the SDK for Java.
Configure trace ID injection.
Enabling trace to logs correlation
The SDK for Java supports both a set of standard application logging frameworks and CloudWatch Logs native support. Before completing the following steps, you must have completed a standard setup of the Amazon X-Ray SDK for Java.
The supported runtimes are Amazon EC2, Amazon EKS with CloudWatch Container Insights enabled, and Lambda.
To enable trace to logs correlation on Amazon EC2, enable the X-Ray EC2 Plugin. For more information, see Service Plugins
To enable trace to logs correlation on Amazon EKS, first enable Container Insights if you have not already done so. For more information, see Using Container Insights.
Then, enable the X-Ray SDK EKS Plugin. For more information, see Service Plugins.
To enable trace to logs correlation on Lambda, you must enable X-Ray on Lambda. For more information, see Amazon Lambda and Amazon X-Ray.
Enabling trace ID injection
For information about how to enable trace ID injection, see Logging.