Bug 1815016 - [RFE] oc logs --all-containers does not use marker to mark the beginning for each container
Summary: [RFE] oc logs --all-containers does not use marker to mark the beginning for ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.4
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.4.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-19 10:38 UTC by Xingxing Xia
Modified: 2020-05-04 11:47 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-04 11:47:02 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:0581 0 None None None 2020-05-04 11:47:24 UTC

Description Xingxing Xia 2020-03-19 10:38:27 UTC
Description of problem:
To debug container logs of multiple-container pod like kube-apiserver, a single `oc logs --all-containers pod_name > pod.log` is convenient, but it does not use marker for the beginning of each container log. This makes user hard to locate the beginning and ending for each container's logs in thousands of lines logs.

Version-Release number of selected component (if applicable):
latest oc got from `oc adm release extract --command oc registry.svc.ci.openshift.org/ocp/release:4.4.0-0.nightly-2020-03-18-102708`

How reproducible:
Always

Steps to Reproduce:
1. oc create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/pods/pod_with_two_containers.json

2. $ oc logs doublecontainers -c hello-openshift
Started, serving at 8080
$ oc logs doublecontainers -c hello-openshift-fedora
serving on 8081
serving on 8888
$ oc logs doublecontainers --all-containers
Started, serving at 8080
serving on 8081
serving on 8888

Actual results:
2. oc logs --all-containers does not use marker to mark the beginning for each container

Expected results:
2. Should have some marker for easy view in situation of thousands of lines logs.

Comment 1 Maciej Szulik 2020-03-20 09:20:39 UTC
This should be already available with --prefix flag which should add pod and/or container name in front of the logs.

Comment 4 zhou ying 2020-03-23 01:49:31 UTC
[root@dhcp-140-138 ~]# oc logs doublecontainers --all-containers --prefix=true
[pod/doublecontainers/hello-openshift] Started, serving at 8080
[pod/doublecontainers/hello-openshift-fedora] serving on 8081
[pod/doublecontainers/hello-openshift-fedora] serving on 8888
[root@dhcp-140-138 ~]# oc version -o yaml 
clientVersion:
  buildDate: "2020-03-23T01:14:57Z"
  compiler: gc
  gitCommit: 2576e482bf003e34e67ba3d69edcf5d411cfd6f3
  gitTreeState: clean
  gitVersion: 4.4.0-202003230106-2576e48
  goVersion: go1.13.4
  major: ""
  minor: ""
  platform: linux/amd64

Comment 6 errata-xmlrpc 2020-05-04 11:47:02 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0581


Note You need to log in before you can comment on or make changes to this bug.