How do you watch the live logs of a running pod?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

How do you watch the live logs of a running pod?

Explanation:
Streaming live logs from a running pod is done by following the log output, which keeps the connection open and prints new lines as they appear. The valid OpenShift approach is the command that uses the -f flag: oc logs -f <pod-name>. The -f option tells the tool to follow the logs in real time, so you continuously see incoming log entries. If you omit -f, oc logs <pod-name> will just display the current log content and then exit, which isn’t watching live logs. Using kubectl logs -f <pod-name> would work if you were using Kubernetes tooling, but in an OpenShift context the established method is to use oc. The command oc tail -f <pod-name> isn’t a recognized syntax, so it won’t work.

Streaming live logs from a running pod is done by following the log output, which keeps the connection open and prints new lines as they appear. The valid OpenShift approach is the command that uses the -f flag: oc logs -f . The -f option tells the tool to follow the logs in real time, so you continuously see incoming log entries. If you omit -f, oc logs will just display the current log content and then exit, which isn’t watching live logs. Using kubectl logs -f would work if you were using Kubernetes tooling, but in an OpenShift context the established method is to use oc. The command oc tail -f isn’t a recognized syntax, so it won’t work.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy