To access the application pod logs by using Red Hat® OpenShift® or Kubernetes CLI method, complete the following steps.
Procedure
- Log in to the Red Hat OpenShift or Kubernetes cluster by using CLI.
- List all the application pods.
For Red Hat OpenShift, use the following command
oc get pods –n <namespace>
For Kubernetes, use the following command
kubectl get pods –n <namespace>
- For execution, enter any pod to check the logs
For Red Hat OpenShift, use the following command
oc exec <pod-name> --namespace=<namespace> -it -- sh
For Kubernetes, use the following command
kubectl exec <pod-name> --namespace=<namespace> -it -- sh
- Go to the path where pod logs are stored and run the following command to see the
application log
cat <path/of/the/log/file>
For example, run the command for JTS
cat /elm/server/conf/jts/logs/repotools-jts_createTables.log