Enabling IBM Gift Center tracing

Add trace statements to your code is helpful for problem determination outside of the development environment. Within the development environment, you can enable tracing by performing the following tasks in the WebSphere Commerce test environment:

  1. Open the following file in a text editor:

    WCDE_installdir\properties\com\ibm\commerce\litecontainer\Logging.properties

  2. Add the IBM Gift Center trace component (com.ibm.websphere.commerce.WC_GIFTREGISTRY) into the Logging.properties file, as follows:
    com.ibm.websphere.commerce.WC_GIFTREGISTRY=true
    
  3. Restart your server.

Tracing output and logging information is written to your WebSphere Commerce development environment console.

The following is an example of how to implement tracing in code that you write while customizing the IBM Gift Center:

public boolean myMethodName() 
{
 final String strMethodName = "myMethodName";
 GiftRegistryTraceLogger.entry(
this.getClass().getName(), strMethodName);
 
 GiftRegistryTraceLogger.trace(
  this.getClass().getName(), 
  strMethodName, 
  "Trace statement");
 
 // check if logging is turned on if the trace 
// statement does a lot of processing
 if (GiftRegistryTraceLogger.isLoggableTrace()) {
  GiftRegistryTraceLogger.trace(
   this.getClass().getName(), 
   strMethodName, 
   "Some complicated trace statement.");
 }
 
 GiftRegistryTraceLogger.exit(getClass().getName(), METHODNAME);
 return true;
}