-
Notifications
You must be signed in to change notification settings - Fork 937
Description
Describe the feature
Add a simple toggle or configuration option in the AWS SDKs (such as Java, Python, etc.) that enables logging of AWS request IDs for every API call at the INFO log level. This toggle should be easily accessible and independent of the underlying logging framework configuration. When enabled, every request made through the SDK would automatically log its request ID, making it straightforward for teams to trace and audit AWS interactions.
Use Case
Debugging and Troubleshooting: Request IDs are essential for correlating application logs with AWS service logs, especially when working with AWS Support to investigate issues.
Security and Auditing: Consistently logging request IDs helps teams trace actions for compliance and security audits.
Operational Consistency: Many teams overlook or inconsistently configure request ID logging due to the need for manual logger setup, leading to gaps in observability and supportability.
Ease of Adoption: A built-in toggle reduces the barrier to following best practices, ensuring all teams—regardless of logging expertise—can benefit from improved traceability.
Proposed Solution
Introduce a Toggle: Add a method or configuration property (e.g., logRequestIds(true)) to the SDK client builder or configuration.
Log at INFO Level: Ensure that, when enabled, all AWS request IDs are logged at the INFO level for every request.
Default Behavior: The toggle should default to false to avoid unexpected increases in log volume, but be easy to enable.
Framework Independence: The feature should work regardless of the logging framework in use, abstracting away logger-specific configuration.
Consistent Output: The log message should clearly indicate the request ID and, if available, the extended request ID for each API call.
// Example for Java SDK
clientBuilder.logRequestIds(true);
Other Information
Current State: At present, logging request IDs requires configuring the logging framework (e.g., Log4j, SLF4J) and setting specific logger names to the appropriate level. This process is not intuitive for all users and is not enabled by default.
Community Feedback: Some users have reported difficulties or inconsistent results when attempting to log request IDs, especially in older SDK versions.
Benefit: This feature would simplify best practice adoption, improve supportability, and enhance security for all users of the AWS SDKs.
Related Patterns: Similar toggles exist in other SDKs for enabling detailed logging, making this a familiar and expected pattern for developers.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
AWS Java SDK version used
2
JDK version used
NA
Operating System and version
NA