Skip to content

Commit de061dd

Browse files
authored
[zh] Update logging.md (#32102)
* Update logging.md fix Sync doc about logging Signed-off-by: LI XIN <[email protected]> * Update logging.md
1 parent 07a2882 commit de061dd

File tree

1 file changed

+16
-3
lines changed
  • content/zh/docs/concepts/cluster-administration

1 file changed

+16
-3
lines changed

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Application logs can help you understand what is happening inside your applicati
2222

2323
<!--
2424
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,
2626
In a cluster, logs should have a separate storage and lifecycle independent of nodes, pods, or containers. This concept is called _cluster-level-logging_.
2727
-->
2828
但是,由容器引擎或运行时提供的原生功能通常不足以构成完整的日志记录方案。
@@ -94,12 +94,25 @@ The output is:
9494
```
9595

9696
<!--
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.
98104
-->
99105
你可以使用命令 `kubectl logs --previous` 检索之前容器实例的日志。
100106
如果 Pod 中有多个容器,你应该为该命令附加容器名以访问对应容器的日志。
101107
详见 [`kubectl logs` 文档](/docs/reference/generated/kubectl/kubectl-commands#logs)
108+
如果 Pod 有多个容器,你应该为该命令附加容器名以访问对应容器的日志,
109+
使用 `-c` 标志来指定要访问的容器的日志,如下所示:
110+
```console
102111

112+
kubectl logs counter -c count
113+
114+
```
115+
详见 [kubectl logs 文档](/zh/docs/reference/generated/kubectl/kubectl-commands#logs)
103116
<!--
104117
## Logging at the node level
105118
@@ -280,7 +293,7 @@ Node-level logging creates only one agent per node, and doesn't require any chan
280293
节点级日志在每个节点上仅创建一个代理,不需要对节点上的应用做修改。
281294

282295
<!--
283-
Containers write stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.
296+
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.
284297
-->
285298
容器向标准输出和标准错误输出写出数据,但在格式上并不统一。
286299
节点级代理

0 commit comments

Comments
 (0)