You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh/docs/concepts/cluster-administration/logging.md
+16-3Lines changed: 16 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Application logs can help you understand what is happening inside your applicati
22
22
23
23
<!--
24
24
However, the native functionality provided by a container engine or runtime is usually not enough for a complete logging solution.
25
-
For example, you may want access your application's logs if a container crashes; a pod gets evicted; or a node dies,
25
+
For example, you may want to access your application's logs if a container crashes; a pod gets evicted; or a node dies,
26
26
In a cluster, logs should have a separate storage and lifecycle independent of nodes, pods, or containers. This concept is called _cluster-level-logging_.
27
27
-->
28
28
但是,由容器引擎或运行时提供的原生功能通常不足以构成完整的日志记录方案。
@@ -94,12 +94,25 @@ The output is:
94
94
```
95
95
96
96
<!--
97
-
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.
97
+
You can use `kubectl logs --previous` to retrieve logs from a previous instantiation of a container.
98
+
If your pod has multiple containers, specify which container's logs you want to access by
99
+
appending a container name to the command, with a `-c` flag, like so:
100
+
```console
101
+
kubectl logs counter -c count
102
+
```
103
+
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
0 commit comments