To enable logging in Java SDK, you will need to do the following:
1. set log4j.properties on your classpath. If your java source code is under the ../src/ folder, you should put the log4j.properties into the same directory. Here is a sample log4j.properties that logs the output to a file:
# the layout property for file appender log4j.appender.File.layout=org.apache.log4j.PatternLayout log4j.appender.File.layout.conversionPattern=%m%n
Note. you can also find a sample log4j.properties in ${SDK Root}samples/consoleAddItemDirect/src folder for a Java standalone application or ${SDK Root}\samples\signinRedirect\src for a Java web application.
2. register ApiLogging object to the ApiContext object as below in your code : ApiLogging logging = new ApiLogging(); apiContext.setApiLogging(apiLogging);