Skip to content

Commit e076534

Browse files
JayBealetengqm
andauthored
Adding an example (#31830)
* Adding an example This text mentions that you can view the logs from a specific container by appending the container name. I've created an example, based on the previous few lines. Also, I've added a -c flag, to bring this in line with both the ```kubectl logs``` [documentation's examples](https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#logs) and other kubectl commands that require the -c flag when selecting a specific container from a pod. * Wrapping long line and marking `-c` as code. Co-authored-by: Qiming Teng <[email protected]> Co-authored-by: Qiming Teng <[email protected]>
1 parent 5be3b2d commit e076534

File tree

1 file changed

+9
-1
lines changed
  • content/en/docs/concepts/cluster-administration

1 file changed

+9
-1
lines changed

content/en/docs/concepts/cluster-administration/logging.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@ The output is:
5757
...
5858
```
5959

60-
You can use `kubectl logs --previous` to retrieve logs from a previous instantiation of a container. If your pod has multiple containers, specify which container's logs you want to access by appending a container name to the command. See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
60+
You can use `kubectl logs --previous` to retrieve logs from a previous instantiation of a container.
61+
If your pod has multiple containers, specify which container's logs you want to access by
62+
appending a container name to the command, with a `-c` flag, like so:
63+
64+
```console
65+
kubectl logs counter -c count
66+
```
67+
68+
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
6169

6270
## Logging at the node level
6371

0 commit comments

Comments
 (0)