How to download the Pega Application Logs in Kubernetes Environment?

This Query posted to assist admins to help on downloading the logs from Kubernetes and OpenShift Environment when there’s no External storage facility of Logs available.

@SaikishoreS16598123

Command to list the log files available in the POD:

kubectl -n exec – ls i.e..

kubectl -n pega-dev-cs exec pega-cs-dev-stream-0 – ls /usr/local/tomcat/logs/pega-cs-dev-stream-0/

Command to Download the Required logs from the POD:

kubectl -n exec – cat /usr/local/tomcat/logs// > i.e..

kubectl -n pega-dev-cs exec pega-cs-dev-batch-58646b6d9b-qnkbs – cat /usr/local/tomcat/logs/pega-cs-dev-batch-58646b6d9b-qnkbs/PegaRULES.log > <File_Name along with Path>

Generate Heat Dumps & Thread Dumps:

  1. jmap -dump:format=b,file=/tmp/heapdump 1

  2. jstack 1 > /tmp/threaddump

@KishoreSanagapalli

Actual Configuration Method:

Ideal puprose of configuring the pega diagnostic user and password is to enable the end-user to download the application logs from Configure-System-Operations-Logs. It’s achieved finally in our Kubernetes environment by making the below changes in the deployment file and performing a Clean Restart.

As shown in the attachment below, Need to configure the pega didiagnostic user and password at all the tiers in the Deployment file and deploy the file will fulfill the need of Application Logs download from Application directly.

Once the Deployment file is changes propagated precisely, You’ll be able to see the changes in the tomcat-users.xml file. Attached the screenshot for the same.