Skip to main content
Published: December 02 2016, 5:18:00 PMUpdated: November 28 2020, 8:59:48 PM


   To enable logging in Java SDK,  you will need to do the following:

   1. set on your classpath. If your java source code is under the ../src/ folder,  you should put the into the same directory.    Here is a sample that logs the output to a file:

log4j.rootLogger = INFO, File

# file appender property

# log file name property
log4j.appender.File.File=${LOG FILE NAME}

# DatePattern property
log4j.appender.File.DatePattern='.' yyyy-MM-dd-a

# the layout property for file appender

 Note. you can also find a sample 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();



How well did this answer your question?
Answers others found helpful