IBM Support

CP4BA ODM How to request http access log for pods

Troubleshooting


Problem

In Liberty, you can do access logs with this link https://openliberty.io/docs/latest/access-logging.html
However, there is no such thing in CP4BA

Diagnosing The Problem

Logging.xml is used in odm pod configMap, but in server.xml , httpAccessLog is there so when you modify the configMap, it gets overwritten.

Resolving The Problem

Created an RFE: https://dba.ideas.ibm.com/ideas/ICPFORA-I-386 , please upvote
Workaround:

To enable http access logs for ODM Helm on OpenShift, follow these steps to modify ODM Helm and WebSphere Liberty

Custom shell script

Create a customEnd.sh with the following to replace and add the accessLoggingRef value in the httpEndpoint xml

#!/bin/bash

sed -i 's|<httpEndpoint|<httpEndpoint accessLoggingRef=\"accessLogging\"|' /config/server.xml

Config Map for the custom shell script

Create a custom ConfigMap pointing to the customEnd.sh.  An empty customStart.sh file is still required to be passed

oc create configmap mycustom-scripts-configmap --from-file=customEnd.sh --from-file=customStart.sh

Custom logging yaml file

Create a custom myCustomLogging.yaml file with the following:

<server>

       <httpAccessLogging filepath="/logs/http_defaultEndpoint_access.log" id ="accessLogging" logFormat='%h %u %{t}W "%r" %s %b %D %{R}W'/>

<logging hideMessage="SRVE9967 W" traceFileName="stdout" traceFormat="BASIC" traceSpecification="*=audit:org.apache.solr.*=w arning:com.ibm.rules.bdsl.search.solr.*=warning" consoleLogLevel="INFO"/>

</server>

Config Map for the custom logging yaml

Create a custom ConfigMap pointing to the custom logging yaml

oc create configmap mycustom-logging-configmap --from-file=myCustomLogging.yaml

Set references to the Config Maps in the ODM Helm values.yaml

In the ODM Helm values.yaml file, specify your custom loggingRef and customScriptsRef ConfigMaps

decisionCenter:

  enabled: true

  tagOrDigest:

  persistenceLocale: en_US

  replicaCount: 1

  customlibPvc: my-custom-dc-libs-pvc

  loggingRef: mycustom-logging-configmap

  jvmOptionsRef:

  webConfigRef:

  extendRoleMapping: false

  disableAllAuthenticatedUser: false

  customScriptsRef: mycustom-scripts-configmap

 

Redeploy or restart the Decision Center Pods

Restart the Decision Center pods. 

When the pods are up, click on the Terminal tab for the pod, you should see the /logs/http_defaultEndpoint_access.log created

image-20240207133207-1

http_defaultEndpoint_access.log will contain the following entries:

image-20240207133244-2

For reference and troubleshooting, scripts such as the customEnd.sh should be in the Decision Center pod’s /script folder

image-20240207133244-3

WebSphere Liberty http access logging parameters

The available log format options for WebSphere Liberty are documented here: https://openliberty.io/docs/latest/access-logging.html

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSBYVB","label":"IBM Cloud Pak for Business Automation"},"ARM Category":[{"code":"a8m3p000000LQR6AAO","label":"Monitor-\u003EODM Monitor"}],"ARM Case Number":"TS015354161","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"23.0.2;and future releases"}]

Document Information

Modified date:
07 February 2024

UID

ibm17116113