User guide
<fileset dir="../../third-party" includes="**/*.jar"/>
<fileset dir="../../lib" includes="**/*.jar"/>
<pathelement location="."/>
</path>
If you are using the Eclipse IDE, you can set the classpath by navigating to:
Project | Properties | Java Build Path
Service-Specific Errors and Warnings
We recommend that you always leave the "com.amazonaws" logger hierarchy set to "WARN" in order to
catch any important messages from the client libraries. For example, if the Amazon S3 client detects that
your application hasn't properly closed an InputStream and could be leaking resources, it will report it
through a warning message to the logs. This will also ensure that messages are logged if the client has
any problems handling requests or responses.
The following log4j.properties file sets the rootLogger to WARN, which will cause warning and error
messages from all loggers in the "com.amazonaws" hierarchy to be included. Alternatively, you can
explicitly set the com.amazonaws logger to WARN.
log4j.rootLogger=WARN, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Or you can explicitly enable WARN and ERROR messages for the AWS Java clients
log4j.logger.com.amazonaws=WARN
Request/Response Summary Logging
Every request to an AWS service generates a unique AWS request ID that is useful if you run into an
issue with how an AWS service is handling a request. AWS request IDs are accessible programmatically
through Exception objects in the SDK for any failed service call, and can also be reported through the
DEBUG log level in the "com.amazonaws.request" logger.
The following log4j.properties file enables a summary of requests and responses, including AWS request
IDs.
log4j.rootLogger=WARN, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n
# Turn on DEBUG logging in com.amazonaws.request to log
# a summary of requests/responses with AWS request IDs
log4j.logger.com.amazonaws.request=DEBUG
Here is an example of the log output:
2009-12-17 09:53:04,269 [main] DEBUG com.amazonaws.request - Sending Request:
Version v1.0.0
19
AWS SDK for Java Developer Guide
Service-Specific Errors and Warnings