Configuring logging for the
To optimize troubleshooting and system diagnostics, you can configure tracing in the by using Run Engine commands or the . The chosen approach should align with your specific deployment architecture (containerized vs. local) and the nature of the issue you are investigating.
- Enabling tracing with Run Engine commands. The recommended method for customer facing or test production environments that are deployed via Docker compose or Kubernetes.
- Enabling tracing in Transaction server by using WebSphere Application Server Administrative Console. This method is only effective in a local . If your deployment uses multiple instances, further customization must be completed in order to connect to a particular container. Additionally, restarting a container eliminates any set trace configuration using this method.
Procedure
-
Enable tracing in your target container by using Run Engine commands. There are
different methods of implementation, and two sets of trace setting Run Engine
command.
Table 2. Examples of setting the trace level on the Method Procedure Enabling trace in a running container in your local Docker environment. You do not need to restart the WAS JVM. Use this method on your local quality assurance or development environment. - Enter your target container.
docker exec -it container_name bash - Set your trace specification. For example, the following command adds
trace on ServiceLogger. For a list of specifications, see Trace
strings.
run set-dynamic-trace-specification com.ibm.commerce.foundation.logging.ServiceLogger=FINEST - Type exit to leave the container.
- Reproduce the issue.
- If you did not configure your Docker container to start with a volume
mount to preserve logs in the Docker host machine, then run the following
commands to make the trace available on the Docker
host.
docker cp container_name:/profile/logs/server1/trace.log /tmp/container_name_trace.log
Creating a new Docker image to include the trace specification by default during start up. Use this method to create custom Docker images to set the trace specification by default. Then you can distribute the custom Docker image. - Create a Dockerfile for the target Docker image.
- In the Dockerfile, define the Run Engine command to set your trace
specification. For example,
run set-trace-specification com.ibm.commerce.foundation.logging.ServiceLogger=FINEST - Create a new Docker image with the Dockerfile.
Providing the trace specification in an advanced system with orchestration tools and remote configuration center. This method also includes the trace specification by default during start up. Docker images can accept a TRACE_SPEC parameter value when starting the container. - Ensure that you configured your orchestration tool to retrieve configuration parameters from your Configuration center.
- In your Configuration center (such as Vault), define the trace
specification in the
TRACE_SPECparameter. - Now, when new containers are deployed, the containers will be configured with your trace specifications.
- Enter your target container.
-
Enable tracing through the . These steps are duplicated
from the documentation. For more information, see the group of topics in the
documentation.
-
Trace components.
The following table includes the trace strings that are available specifically for the . In some cases, you might need to enable trace strings in multiple servers to fully troubleshoot a component. For more information, see the MustGather sections in Trace components.
Component Trace string Access control com.ibm.websphere.commerce.WC_ACCESSCONTROL=all: com.ibm.commerce.foundation.logging.ServiceLogger=allAttribute Dictionary com.ibm.commerce.tools.*=all: com.ibm.commerce.catalog.*=all: com.ibm.commerce.foundation.*=all: com.ibm.websphere.commerce.WC_SERVER=allCatalog com.ibm.websphere.commerce.WC_CATALOG=all: com.ibm.commerce.foundation.*=all: com.ibm.websphere.commerce.WC_SERVER=all: com.ibm.commerce.foundation.client.lobtools.*=all: com.ibm.commerce.catalog.*=allCatalog filters com.ibm.commerce.catalog.*=all: com.ibm.commerce.catalogentry.*=all: com.ibm.commerce.contract.*=all: com.ibm.commerce.foundation.*=all: com.ibm.websphere.commerce.WC_CATALOG=all: com.ibm.websphere.commerce.WC_CONTRACT=allCommerce Composer *=info: com.ibm.commerce.foundation.logging.*=all: com.ibm.commerce.pagelayout.*=allCross site protection com.ibm.websphere.commerce.WC_SERVER=all: com.ibm.commerce.foundation.logging.*=allData load - Data load framework trace
com.ibm.commerce.foundation.dataload.*=all - Catalog data load
com.ibm.commerce.catalog.dataload.*=all - Promotion data load
com.ibm.commerce.promotion.dataload.*=all - Marketing data load
com.ibm.commerce.marketing.dataload.*=all - Price data load
com.ibm.commerce.price.dataload.*=all
Dynamic Cache The following strings are useful for diagnosing cache-related problems on the . The trace strings are listed from the highest-level and most important tracing to the most detailed.
Each trace string creates some extra logging and can impact performance. 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.dynacache.commands.*=all: com.ibm.commerce.foundation.logging.*=all: com.ibm.commerce.datatype.*=all: com.ibm.websphere.commerce.WC_CACHE=all: com.ibm.ws.cache.*=allcom.ibm.commerce.foundation.client.lobtools.*=all: com.ibm.commerce.foundation.logging.*=allMarketing com.ibm.websphere.commerce.WC_MARKETING=all: com.ibm.commerce.marketing.*=all: com.ibm.commerce.foundation.*=all: com.ibm.commerce.content.*=all: com.ibm.commerce.membergroup.*=all: com.ibm.websphere.commerce.WC_USER=allcom.ibm.commerce.marketing.cache.*=all: com.ibm.commerce.store.marketing.*=all: com.ibm.commerce.foundation.logging.*=allOrders com.ibm.websphere.commerce.WC_ORDER=all: com.ibm.websphere.commerce.WC_CALCULATION=all: com.ibm.websphere.commerce.WC_EDP=all: com.ibm.websphere.commerce.WC_PPC=all: com.ibm.websphere.commerce.WC_INVENTORY=all: com.ibm.commerce.foundation.logging.*=allOrders (calculation framework) com.ibm.websphere.commerce.WC_ORDER=all: com.ibm.websphere.commerce.WC_CALCULATION=all: com.ibm.websphere.commerce.WC_MARKETING=all: com.ibm.commerce.foundation.logging.*=allPrice rules com.ibm.commerce.foundation.*=all: com.ibm.commerce.price.*=all: com.ibm.websphere.commerce.WC_CONTRACT=all: com.ibm.websphere.commerce.WC_ORDER=all: com.ibm.commerce.catalog.*=allPromotion com.ibm.websphere.commerce.WC_ORDER=all: com.ibm.websphere.commerce.WC_CALCULATION=all: com.ibm.commerce.marketing.promotion.*=all: com.ibm.commerce.promotion.*=all: com.ibm.commerce.foundation.logging.*=allSearch build index *=info:com.ibm.commerce.foundation.*=all: com.ibm.commerce.rest.*=all: com.ibm.commerce.catalog.facade.server.*=finestSearch health check *=info:com.ibm.commerce.rest.*=finestSearch rules :*=info:com.ibm.commerce.rest.*=all: com.ibm.commerce.marketing.*=all: com.ibm.commerce.foundation.*=all: com.ibm.commerce.catalog.*=finestSearch Rules Based Sales Categories *=info:com.ibm.commerce.rest.*=all: com.ibm.commerce.marketing.*=all: com.ibm.commerce.foundation.*=allSearch scheduled job for update index com.ibm.commerce.foundation.dataimport.*=all: com.ibm.commerce.foundation.logging.*=allSEO *=info: com.ibm.commerce.seo.*=all: com.ibm.commerce.foundation.logging.*=allSession Management If the issue is not related to Business Context, use this trace string:com.ibm.commerce.foundation.logging.ServiceLogger=all: com.ibm.websphere.commerce.WC_SERVER=all: com.ibm.websphere.commerce.WC_SESSIONMANAGEMENT=all: com.ibm.commerce.foundation.rest.handlers.*=allIf the issue is related to Business Context, use this trace string:com.ibm.commerce.foundation.logging.ServiceLogger=all: com.ibm.websphere.commerce.WC_SERVER=all: com.ibm.websphere.commerce.WC_SESSIONMANAGEMENT=all: com.ibm.commerce.foundation.rest.handlers.*=all: com.ibm.websphere.commerce.WC_BUSINESSCONTEXT=allUser registration and login com.ibm.websphere.commerce.WC_USER=all: com.ibm.commerce.foundation.logging.ServiceLogger=all - Data load framework trace