Home
Find the answer to your question
Summary
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:
log4j.rootLogger = INFO, File # log file name property # DatePattern property |
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);