For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

Enable logging for Java SDK

  • Answer ID 1711
  • Published 12/02/2016 04:18 PM
  • Updated 12/02/2016 04:18 PM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=1711

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

# file appender property
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender

# 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
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); 


   

  

How well did this answer your question?

Answers others found helpful

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter