Handling FDM logs on kubernetes/openshift
search cancel

Handling FDM logs on kubernetes/openshift

book

Article ID: 443838

calendar_today

Updated On:

Products

CA Test Data Manager (Data Finder / Grid Tools)

Issue/Introduction

The current logging solution only supports static log file name list in values.yaml.

On the other hand, the fdm log, fdm error log are dynamically created with dynamic filename during masking job.

They are not configurable in values.yaml file.

Environment

TDM docker portal 4.11.x, 5.0.10.10

Resolution

1. Prepare the logger.sh (see the attachment)

upload the logger.sh to the TDM shared PV -- in this example, it is saved to /home/tdm/.tdm/logs/logger.sh

2. Use the helm chart tdm-5.0.13.tgz or above, update the tdmweb.logs in values.yaml as the example as below,

tdmweb:
#...
  logs:
    enabled: true
    image: bash
    tag: "latest"
    command: "/home/tdm/.tdm/logs/logger.sh %s"
    lifecycle:
      preStop:
        command:
          - /bin/sh
          - -c
          - while [ ! -f /tmp/stop-sidecar.txt ]; do sleep 1; done; pkill sleep; pkill tail
    resources:
      requests:
        memory: 0.25Gi
        cpu: 100m
      limits:
        memory: 0.25Gi
        cpu: 100m
    containers:
       - name: tdmloggingall
         path: "/home/tdm/.tdm/logs /home/tdm/.tdm/logs/fdm"

3. Deploy TDM 

4. Check the combined logs

(the example is for openshift)

oc logs -f <tdmweb pod name> -c logs-tdmloggingall

 

Note:

1. The example uses docker.io/bash:latest image, it can be changed to any lightweight linux which supports bash

 

2. The following line in values.yaml

    command: "/home/tdm/.tdm/logs/logger.sh %s"

depends on where you deploy the logger.sh file

 

3. The following line in values.yaml

         path: "/home/tdm/.tdm/logs /home/tdm/.tdm/logs/fdm"

specifies what log folders to be monitored by logger.sh, separate by space

 

4.The logger.sh script will send all the existing logs, new created logs to the STDOUT, the format of combined log is:

<log filename>: <log message>

for example:

$ oc logs -f tdmweb-54d8cd4c69-p22d7 -c logs-tdmloggingall

 

TDMMaskingService.tdmweb.log:  2026-06-02 00:26:11.253 EDT [DEBUG] [grpc-default-executor-2  ] --- [U:][M:][P:]          c.c.t.f.s.a.MaskingPodsAutoScalerService:  IsActive called masking-pods-auto-scaler. - is-active='true'

TDMMaskingService.masking-77ddc749c8-d4724.log:  2026-06-02 00:26:12.066 EDT [DEBUG] [https-jsse-nio-8443-exec-8] --- [U:][M:][P:]                      c.c.t.f.c.FDMAgentController:  Starting method getAgentStatus()

TDMMaskingService.tdmweb.log:  2026-06-02 00:26:19.115 EDT [INFO ] [MessageBroker-4          ] --- [U:][M:][P:]                   c.c.t.f.s.MessageServiceManager:  Cleanup compressed files chunks unfinished after 'Tue Jun 02 04:21:19 UTC 2026'.

TDMFindReserve.log:  2026-06-02 00:26:36.626 EDT [DEBUG] ['FINDRESERVE_JOB_SCHEDULER'_Worker-2] --- [U:][M:][P:]            c.c.t.f.s.j.DataViewInstanceCleanupJob:  DataViewInstanceCleanupJob started

TDMFindReserve.log:  2026-06-02 00:26:36.644 EDT [DEBUG] ['FINDRESERVE_JOB_SCHEDULER'_Worker-2] --- [U:][M:][P:]            c.c.t.f.s.j.DataViewInstanceCleanupJob:  DataViewInstanceCleanupJob finished

To dump all the logs in monitored log folders,

oc logs tdmweb-586564f5cb-twr29 -c logs-tdmloggingall > tdmfulllog

 

 

Attachments

logger.sh get_app