Details
-
Feature Request
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
kube-apiserver, Logging, Node, oc, Pod
-
False
-
None
-
False
-
Not Selected
-
0
-
0%
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