Uploaded image for project: 'OpenShift Request For Enhancement'
  1. OpenShift Request For Enhancement
  2. RFE-3026

Need an option to display pod logs from all rotated log files

    XMLWordPrintable

Details

    • Feature Request
    • Status: Backlog (View Workflow)
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • kube-apiserver, Node, oc, Pod
    • None
    • False
    • None
    • False
    • Not Selected

    Description

      1. Proposed title of this feature request
      Command `oc logs` must have an option to display logs from previous rotated log files.

      2. What is the nature and description of the request?
      Command `oc logs` returns the logs from last roation only.

      Customer is looking for an option to check pod logs from previous generated/rotated log files with `oc logs` command.
      For example: If there are below logs files generated for a pod, and 0.log is the latest one. Customer wants to check logs from previous files using `oc logs` command.
      ~~~
      [root@<node>]# ls -lh
      total 104M
      rw------. 1 root root  31M Jul 12 16:51 0.log
      rw-rr-. 1 root root 5.4M Jun 25 14:26 0.log.20220621-150613.gz
      rw-rr-. 1 root root 6.5M Jul  2 11:09 0.log.20220625-142606.gz
      rw-rr-. 1 root root 6.9M Jul  8 21:27 0.log.20220702-110919.gz
      ~~~

      Note :
      I checked this command $ oc logs [-p] <POD-NAME> [-c CONTAINER] [flags]

      You can use oc logs to retrieve logs from a previous instantiation of a container with --previous (-p) flag, in case the container has crashed.
      This gives the logs from terminated container , not the old logs from the running container.

      Customer is looking for the logs stored in other log files (kubelet was setup to have 5 files of 50M per container).

      3. Why does the customer need this? (List the business requirements here)
      Customer mentioned : The purpose is that user working on their app's namespace need to export all their pods's log by himself.
      But for now, if they need all logs, administrator need to collect them directly from the node. It's not convenient.

      4. List any affected packages or components.
      oc, kube-apiserver , kubelet, node, pod

      Attachments

        Activity

          People

            anachand Anandnatraj Chandramohan
            rhn-support-sdharma Suruchi Dharma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: