Configure logging for the Store server (Developer environment)

We can configure logging in the Store server by updating the WAS Liberty server.xml file.

Note:

When you work with IBM to debug request processing problems, there might be occasions where low-level tracing components must be enabled to capture details for how the request is processed. These low-level Application server trace components do not know the request intent or the potential data within. Therefore, when enabled, it is possible that these tracing components might potentially include sensitive information, in plain text, in the trace file.

It is recommended that you do not enable these types of tracing components on a production system and attempt to simulate the problem on a quality assurance environment to capture the appropriate information. However, if the tracing components must be enabled on a production system, handle the trace files with caution. Before you send the trace, remove sensitive data that might be in the trace before you allow a third party to use the trace for diagnosis. Further, when the trace is no longer required, remove the files with a military-grade data wiping process. When the problem is found and the tracing component is no longer required, immediately disable the low-level tracing components.


Procedure

  1. Go to the Liberty_installdir/usr/servers/crsServer/configDropins/overrides directory.

  2. Within the overrides directory, create a server.xml file.

  3. Add trace settings within your new server.xml file to enable the trace that set. Set logging properties by adding the trace specification as a logging element within the file. Use the following format to set your trace specification:

      <server> 
        <logging traceSpecification="component=level:component=level"/>
      </server>

    Where component is the component for which to set a log detail level, and level is one of the valid logger levels (off, fatal, severe, warning, audit, info, config, detail, fine, finer, finest, all). Separate multiple log detail level specifications with colons (:) The following example log element sets the trace specification for a component to the finest log level:

      <server description="Enable trace on Liberty">
        <logging traceSpecification="*=audit:com.myco.mypackage.*=finest"/>
      </server>

    For more information about setting logging properties within WebSphere Liberty, see .

    Here are a set of WebSphere Commerce-related trace strings that we can use.

    Component Trace string
    Marketing

      com.ibm.commerce.marketing.cache.*=all
      com.ibm.commerce.store.marketing.*=all
      com.ibm.commerce.foundation.logging.*=all

    Search

      com.ibm.commerce.foundation.*=all:
      com.ibm.commerce.rest.*=all

    Dynamic Cache

    Each trace string creates some extra logging and can impact performance. If you need to reduce the performance impact, remove the trace strings beginning from the end of the list, unless a particular string is required for diagnosing the initial issue.

      com.ibm.commerce.component.cache.config.*=all
      com.ibm.commerce.dynacache.filter.*=all
      com.ibm.commerce.foundation.logging.*=all

    Session Management

      com.ibm.commerce.store.foundation.session.*=all
      com.ibm.commerce.foundation.logging.*=all

    Access control

      com.ibm.commerce.component.helper.*=all
      com.ibm.commerce.component.registry.*=all
      com.ibm.commerce.foundation.logging.*=all

    Cross site protection

      com.ibm.commerce.store.foundation.utils.*=all
      com.ibm.commerce.foundation.logging.*=all

    SEO

      com.ibm.commerce.component.seo.*=all
      com.ibm.commerce.store.foundation.internal.client.taglib.*=all
      com.ibm.commerce.foundation.logging.*=all

    Commerce Composer

      com.ibm.commerce.store.pagelayout.*=all
      com.ibm.commerce.store.pagelayout.internal.client.taglib.*=all
      com.ibm.commerce.foundation.logging.*=all

    Store foundation

      com.ibm.commerce.component.mvc.*=all
      com.ibm.commerce.store.mvc.*=all
      com.ibm.commerce.store.servlet.*=all
      com.ibm.commerce.component.server.*=all
      com.ibm.commerce.component.internal.client.util.*=all
      com.ibm.commerce.component.rest.helper.*=all
      com.ibm.commerce.client.rest.RestClientReadEfficiencyLogger=fine
      com.ibm.commerce.foundation.logging.service.RestClientLogger=fine
      com.ibm.commerce.foundation.logging.*=all


Results

The trace configuration is set for the server. You do not need to restart a server for the log configuration to take effect. The changes are automatically applied. Your logging configuration remain until you change the server.xml file again.