Configuring logging

The Operational Decision Manager components produce logs that capture all sorts of messages and events. These logs help you to debug the component when a problem occurs.

About this task

When you install Operational Decision Manager, the following configmap files are generated. They define the default log levels for each Operational Decision Manager component.

Table 1. Naming convention for configmap files
Component Name of configmap
Decision Center <instance_name>-odm-dc-logging-configmap
Decision Runner <instance_name>-odm-dr-logging-configmap
Decision Server console <instance_name>-odm-ds-console-logging-configmap
Decision Server Runtime <instance_name>-odm-ds-runtime-logging-configmap

Where <instance_name> is the name of the custom resource file.

Table 2. Logging level default values of Operational Decision Manager components
ODM component traceSpecification traceFileName traceFormat
Decision Center
:*=audit
:org.apache.solr.*=warning
:com.ibm.rules.bdsl.search.solr.*=warning
="stdout" ="BASIC"
Decision Runner

Decision Server console

Decision Server Runtime

:*=audit
:com.ibm.rules.*=info
:ilog.rules.*=info
="stdout" ="BASIC"

The default loggers that are listed in the traceSpecification column provide a good level of messages without impacting performance.

Attention: Increasing the log level might slow down the execution performance drastically.
Note: You perform the following steps when you configure the custom resource file (CR).

Procedure

  1. Create an XML Liberty logging.xml file with the new log levels.
    You can find a sample of this file in cert-kubernetes/ODM/configuration/logging. For more information about downloading cert-kubernetes, see Option 1: Preparing your cluster for an online deployment.
  2. Create a configmap with a key that corresponds to the Operational Decision Manager component that you want to modify.
    The following keys must be used:
    • Decision Center: dc-logging
    • Decision Runner: dr-logging
    • Decision Server console: dsc-logging
    • Decision Server Runtime: dsr-logging

    For example, to create a logging configmap for Decision Center, enter the following command:

    kubectl create configmap my-odm-dc-logging-configmap --from-file=dc-logging=logging.xml
    
  3. Associate the new configmap to the application definition by using the loggingRef parameter in the custom resource .yaml file that the operator used to deploy Operational Decision Manager.

    For example, to change the logging in Decision Center, specify the following in the .yaml file:

    decisionCenter:
       loggingRef: my-odm-dc-logging-configmap
  4. Apply the change to the existing containers by running the kubectl apply command on the custom resource .yaml file:
    kubectl apply -f custom_resources.yaml

Results

The operator modifies the application to use the new configmap and updates the /config/logging/logging.xml file.

The /logs/messages.log file of the ODM container shows the change in a new message. For example, the following message shows a change to the trace state.

com.ibm.ws.logging.internal.TraceSpecification I TRAS0018I: The trace state has been changed. The new trace state is ...