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 <tengqm@outlook.com> Co-authored-by: Qiming Teng <tengqm@outlook.com>pull/31863/head
parent
5be3b2de8e
commit
e0765344a9
|
@ -57,7 +57,15 @@ The output is:
|
|||
...
|
||||
```
|
||||
|
||||
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.
|
||||
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, with a `-c` flag, like so:
|
||||
|
||||
```console
|
||||
kubectl logs counter -c count
|
||||
```
|
||||
|
||||
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
|
||||
|
||||
## Logging at the node level
|
||||
|
||||
|
|
Loading…
Reference in New Issue