Customizing log parameters

You can customize the log parameters to capture logs and use them for further analysis.

The following sections explain the recommended steps for redirecting logs to a specific location, such as Persistent Volume.

Customizing Sterling Order Management System Software runtime

This section explains how to customize the Sterling Order Management System Software runtime.

Configuring log4j1
In addition to the information provided for customizing log4j1 configuration, you can update the appender configuration in the custom log4j1 file to redirect the log files to a different location as illustrated in the following examples.
In addition to the information provided for customizing log4j1 configuration, you can update the appender configuration in the custom log4j1 file to redirect the log files to a different location as illustrated in the following examples.
<appender name="ALL" class="com.sterlingcommerce.woodstock.util.frame.logex.SCIAppender">
        .
        .
        <param name="file" value="${LOG_DIR}/${JVM}_sci.log" />
        .
    </appender>
<appender name="AGENT_LOG_APPENDER" class="com.sterlingcommerce.woodstock.util.frame.logex.SCIAppender">
        .
        .
        <param name="file" value="${LOG_DIR}/${JVM}_agentserver.log" />
        .
    </appender>
Including the custom log4j1 in resources.jar
To include the custom log4j1 in resources.jar, run the following commands:

cp ${EXTN_DIR}/resources/log4jconfig.custom.xml ${INSTALL_DIR}/resources

${INSTALL_DIR}/bin/deployer.sh -t resourcejar

Legacy platform

Configuring the Helm chart values

This section explains the configurations of Helm chart values.

Configuring the custom environment variables in the Helm chart
Ensure that you set the environment variables in the Helm chart to match the variables that are defined in the custom log4j1 configuration.
  envs:
  - name: LOG_DIR
    value: /shared/logs/$(OM_POD_NAME)
  - name: WLP_OUTPUT_DIR
    value: /shared/logs/$(OM_POD_NAME)
Customizing the Liberty application server JVM arguments
To customize the application server for log redirection, add the following parameters in jvm.options.
-verbose:gc
-Xverbosegclog:$(LOG_DIR)/appserver-om-app_verbosegc_D%Y%m%d.T%H%M%S.txt
-DLOG_DIR=$(LOG_DIR)
-DWLP_OUTPUT_DIR=$(LOG_DIR)
-DJVM=$(OM_POD_NAME)
-Xdump:heap+java:events=user
-Xgcpolicy:gencon
-XX:HeapDumpPath=$(LOG_DIR)
By adding these parameters, you are:
  • Enabling the verbose garbage collection in addition to configuring the path where the verbose garbage collection logs are generated.
  • Setting the LOG_DIR, WLP_OUTPUT_DIR, and HeapDumpPath to the LOG_DIR environment variable that is defined in the Helm chart.
  • Passing the pod name as an argument to Java with the name, JVM.
  • Enabling heap dumps on user events.
  • Setting the garbage collection policy to generational concurrent.
Customizing the agent server JVM arguments
Pass the following JVM arguments to agent server by using omserver.common.jvmArgs or omserver.servers.jvmArgs parameters in values.yaml. For more information about these parameters, see the Readme file.
jvmArgs: "-DLOG_DIR=$(LOG_DIR) -DJVM=$(OM_POD_NAME) -verbose:gc -Xverbosegclog:$(LOG_DIR)/$(OM_POD_NAME)_verbosegc_D%Y%m%d.T%H%M%S.txt -Xdump:heap+java:events=user -Xgcpolicy:gencon -XX:HeapDumpPath=$(LOG_DIR)"