Which command is used to stream live logs of a 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

Which command is used to stream live logs of a pod?

Explanation:
Streaming live logs from a pod is done by following the logs output as it’s written. In OpenShift, use oc logs -f <pod-name>. The -f (follow) option keeps the connection open and prints new lines as the container writes them, just like tail -f. Without -f you’d only see the existing logs up to that moment. If the pod has multiple containers, you can stream a specific one with -c <container-name>. In Kubernetes generally you’d use kubectl logs -f <pod-name>, but within OpenShift the oc variant is used.

Streaming live logs from a pod is done by following the logs output as it’s written. In OpenShift, use oc logs -f . The -f (follow) option keeps the connection open and prints new lines as the container writes them, just like tail -f. Without -f you’d only see the existing logs up to that moment. If the pod has multiple containers, you can stream a specific one with -c . In Kubernetes generally you’d use kubectl logs -f , but within OpenShift the oc variant is used.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy