HCL Commerce Version 9.1.12.0 or later

Configuring logging for the Approval server

You can configure logging in the Approval Server Docker container by running the setRuntimeTraceSpecs script.

Procedure

  1. Optional: If you are logging external REST API calls, you must set the log level for the local Feign API client, depending on the level of trace detail that is required.
    1. Open the app-secure.properties configuration file for editing in your persisted volume for the Approval Server Docker container.
      For more information on this file, see app-secure.properties.
    2. Set the log level value.
      feign.client.config.default.loggerLevel=LOGGER_LEVEL
      Where the available levels are:
      • NONE - Log nothing.
      • BASIC - Log the request method, URL, the response status code, and the execution time.
      • HEADERS - Log basic information along with request and response headers.
      • FULL - Log the headers, body, and metadata for both requests and responses.
      By default, the log level on the Approval Server Docker container is set to BASIC.

      For more information on the Feign client, see Feign logging in the Spring Cloud OpenFeign documentation.

    3. Save and close the file.
    4. Restart the container.
      Changes to the Feign API client are only applied once the container is restarted.
  2. Set the trace specification within your Approval Server Docker container using the setRuntimeTraceSpecs script.
    1. Navigate to the /SETUP/bin/ directory.
    2. Run the setRuntimeTraceSpecs script with the component or components that you want to be traced.
      ./setRuntimeTraceSpecs.sh TRACE_COMPONENT_WITH_LEVEL

      The following table includes the trace strings that are available specifically for the Approval Server Docker container. 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
      Marketplace approval-related issues
      com.hcl.commerce.approval.Logging=trace:com.hcl.commerce.approval.marketplace=trace
      
      Notification-related issues
      com.hcl.commerce.approval.Logging=trace:com.hcl.commerce.approval.notification=trace
      
      Security and Access Control Policy (ACP) related issues
      com.hcl.commerce.approval.Logging=trace:com.hcl.commerce.approval.security=trace:com.hcl.commerce.approval.interceptors.ApprovalAccessHelperInterceptor=trace:com.hcl.commerce.approval.marketplace.access=trace
      Clean-up activity related issues
      com.hcl.commerce.approval.Logging=trace:com.hcl.commerce.approval.marketplace.scheduler.ApprovalDBCleanUpScheduler=trace
      External REST API related issues
      com.hcl.commerce.approval.Logging=trace:com.hcl.commerce.approval.external.clients=trace
      Note: Depending on the level of trace that is set, you may not obtain all of the produced log details. Before setting the trace level for the Approval server, review step #1 to set the appropriate log level value for Feign in order to capture the appropriate level of verbosity.
      Available log levels are:
      • trace
      • debug
      • info
      • warn
      • error
      • fatal
      Note:
      • When configured as trace, all messages are displayed.
      • When configured as debug, all messages are displayed except those tagged as trace.
      • When configured as info, all messages at levels info through fatal are displayed.
      By default, server-side API client log messages are displayed at level:
      • HCL Commerce Version 9.1.14.0info
      • HCL Commerce Version 9.1.13.0trace
      .

Results

Logging is now configured. You can now reproduce any issues and collect the associated logs for troubleshooting purposes.