Skip to content

Commit bb70000

Browse files
committed
[zh] sync logging.md and system-logs.md
1 parent 3df479c commit bb70000

File tree

3 files changed

+76
-76
lines changed

3 files changed

+76
-76
lines changed

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

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,13 @@ appending a container name to the command, with a `-c` flag, like so:
118118
如果你的 Pod 有多个容器,请如下通过将容器名称追加到该命令并使用 `-c`
119119
标志来指定要访问哪个容器的日志:
120120

121-
```console
121+
```shell
122122
kubectl logs counter -c count
123123
```
124124

125125
<!--
126-
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
126+
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs)
127+
for more details.
127128
-->
128129
详见 [`kubectl logs` 文档](/docs/reference/generated/kubectl/kubectl-commands#logs)
129130

@@ -167,7 +168,8 @@ kubelet 通过 Kubernetes API 的特殊功能将日志提供给客户端访问
167168
<!--
168169
You can configure the kubelet to rotate logs automatically.
169170
170-
If you configure rotation, the kubelet is responsible for rotating container logs and managing the logging directory structure.
171+
If you configure rotation, the kubelet is responsible for rotating container logs and managing the
172+
logging directory structure.
171173
The kubelet sends this information to the container runtime (using CRI),
172174
and the runtime writes the container logs to the given location.
173175
-->
@@ -180,7 +182,8 @@ kubelet(使用 CRI)将此信息发送到容器运行时,而运行时则将
180182
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/),
181183
`containerLogMaxSize` and `containerLogMaxFiles`,
182184
using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/).
183-
These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively.
185+
These settings let you configure the maximum size for each log file and the maximum number of
186+
files allowed for each container respectively.
184187
185188
When you run [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands#logs) as in
186189
the basic logging example, the kubelet on the node handles the request and
@@ -196,8 +199,7 @@ kubelet [配置选项](/zh-cn/docs/reference/config-api/kubelet-config.v1beta1/#
196199

197200
{{< note >}}
198201
<!--
199-
Only the contents of the latest log file are available through
200-
`kubectl logs`.
202+
Only the contents of the latest log file are available through `kubectl logs`.
201203
202204
For example, if a Pod writes 40 MiB of logs and the kubelet rotates logs
203205
after 10 MiB, running `kubectl logs` returns at most 10MiB of data.
@@ -264,14 +266,12 @@ kubelet logs to a directory that you choose.
264266
并使用该工具将 kubelet 日志重定向到你所选择的目录。
265267

266268
<!--
267-
You can also set a logging directory using the deprecated kubelet command line
268-
argument `--log-dir`. However, the kubelet always directs your container runtime to
269-
write logs into directories within `/var/log/pods`.
269+
The kubelet always directs your container runtime to write logs into directories within
270+
`/var/log/pods`.
270271
271272
For more information on `kube-log-runner`, read [System Logs](/docs/concepts/cluster-administration/system-logs/#klog).
272273
-->
273-
你还可以使用已弃用的 kubelet 命令行参数 `--log-dir` 设置日志目录。
274-
但是,kubelet 始终指示你的容器运行时将日志写入 `/var/log/pods` 中的目录。
274+
kubelet 始终指示你的容器运行时将日志写入 `/var/log/pods` 中的目录。
275275

276276
有关 `kube-log-runner` 的更多信息,请阅读[系统日志](/zh-cn/docs/concepts/cluster-administration/system-logs/#klog)
277277

@@ -393,7 +393,8 @@ application containers on that node.
393393
Because the logging agent must run on every node, it is recommended to run the agent
394394
as a `DaemonSet`.
395395
396-
Node-level logging creates only one agent per node and doesn't require any changes to the applications running on the node.
396+
Node-level logging creates only one agent per node and doesn't require any changes to the
397+
applications running on the node.
397398
-->
398399
由于日志记录代理必须在每个节点上运行,推荐以 `DaemonSet` 的形式运行该代理。
399400

@@ -417,7 +418,8 @@ You can use a sidecar container in one of the following ways:
417418

418419
<!--
419420
* The sidecar container streams application logs to its own `stdout`.
420-
* The sidecar container runs a logging agent, which is configured to pick up logs from an application container.
421+
* The sidecar container runs a logging agent, which is configured to pick up logs
422+
from an application container.
421423
-->
422424
* 边车容器将应用程序日志传送到自己的标准输出。
423425
* 边车容器运行一个日志代理,配置该日志代理以便从应用容器收集日志。
@@ -646,7 +648,8 @@ The pod mounts a volume where fluentd can pick up its configuration data.
646648
![直接从应用程序暴露日志](/images/docs/user-guide/logging/logging-from-application.png)
647649

648650
<!--
649-
Cluster-logging that exposes or pushes logs directly from every application is outside the scope of Kubernetes.
651+
Cluster-logging that exposes or pushes logs directly from every application is outside the scope
652+
of Kubernetes.
650653
-->
651654
从各个应用中直接暴露和推送日志数据的集群日志机制已超出 Kubernetes 的范围。
652655

@@ -655,7 +658,8 @@ Cluster-logging that exposes or pushes logs directly from every application is o
655658
<!--
656659
* Read about [Kubernetes system logs](/docs/concepts/cluster-administration/system-logs/)
657660
* Learn about [Traces For Kubernetes System Components](/docs/concepts/cluster-administration/system-traces/)
658-
* Learn how to [customise the termination message](/docs/tasks/debug/debug-application/determine-reason-pod-failure/#customizing-the-termination-message) that Kubernetes records when a Pod fails
661+
* Learn how to [customise the termination message](/docs/tasks/debug/debug-application/determine-reason-pod-failure/#customizing-the-termination-message)
662+
that Kubernetes records when a Pod fails
659663
-->
660664
* 阅读有关 [Kubernetes 系统日志](/zh-cn/docs/concepts/cluster-administration/system-logs/)的信息
661665
* 进一步了解[追踪 Kubernetes 系统组件](/zh-cn/docs/concepts/cluster-administration/system-traces/)

content/zh-cn/docs/concepts/cluster-administration/system-logs.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,20 @@ scheduler decisions).
3333
<!--
3434
klog is the Kubernetes logging library. [klog](https://github.com/kubernetes/klog)
3535
generates log messages for the Kubernetes system components.
36-
37-
For more information about klog configuration, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
3836
-->
3937
klog 是 Kubernetes 的日志库。
4038
[klog](https://github.com/kubernetes/klog)
4139
为 Kubernetes 系统组件生成日志消息。
4240

43-
有关 klog 配置的更多信息,请参见[命令行工具参考](/zh-cn/docs/reference/command-line-tools-reference/)
44-
4541
<!--
4642
Kubernetes is in the process of simplifying logging in its components.
4743
The following klog command line flags
4844
[are deprecated](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
49-
starting with Kubernetes 1.23 and will be removed in a future release:
45+
starting with Kubernetes v1.23 and removed in Kubernetes v1.26:
5046
-->
51-
Kubernetes 正在进行简化其组件日志的努力。下面的 klog 命令行参数从 Kubernetes 1.23
47+
Kubernetes 正在进行简化其组件日志的努力。下面的 klog 命令行参数从 Kubernetes v1.23
5248
开始[已被废弃](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
53-
会在未来版本中移除
49+
在 Kubernetes v1.26 中被移除
5450

5551
- `--add-dir-header`
5652
- `--alsologtostderr`
@@ -168,7 +164,7 @@ compatible with traditional klog:
168164
-->
169165
默认的结构化日志消息是以文本形式呈现的,其格式与传统的 klog 保持向后兼容:
170166

171-
```ini
167+
```
172168
<klog header> "<message>" <key1>="<value1>" <key2>="<value2>" ...
173169
```
174170

@@ -177,7 +173,7 @@ Example:
177173
-->
178174
示例:
179175

180-
```ini
176+
```
181177
I1025 00:15:15.525108 1 controller_utils.go:116] "Pod status updated" pod="kube-system/kubedns" status="ready"
182178
```
183179

@@ -449,10 +445,9 @@ The complete list of options that can be used are:
449445
-->
450446
kubelet 使用启发方式来检索日志。
451447
如果你还未意识到给定的系统服务正将日志写入到操作系统的原生日志记录程序(例如 journald)
452-
`/var/log/` 中的日志文件,这会很有帮助。
453-
这种启发方式先检查原生的日志记录程序,如果不可用,则尝试从
454-
`/var/log/<servicename>``/var/log/<servicename>.log``/var/log/<servicename>/<servicename>.log`
455-
中检索第一批日志。
448+
`/var/log/` 中的日志文件,这会很有帮助。这种启发方式先检查原生的日志记录程序,
449+
如果不可用,则尝试从 `/var/log/<servicename>``/var/log/<servicename>.log`
450+
`/var/log/<servicename>/<servicename>.log` 中检索第一批日志。
456451

457452
可用选项的完整列表如下:
458453

content/zh-cn/docs/test.md

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,9 @@ Markdown doesn't have strict rules about how to process lists. When we moved
116116
from Jekyll to Hugo, we broke some lists. To fix them, keep the following in
117117
mind:
118118
119-
- Make sure you indent sub-list items **2 spaces**.
119+
- Make sure you indent sub-list items **2 spaces**.
120120
121-
- To end a list and start another, you need a HTML comment block on a new line
121+
- To end a list and start another, you need an HTML comment block on a new line
122122
between the lists, flush with the left-hand border. The first list won't end
123123
otherwise, no matter how many blank lines you put between it and the second.
124124
-->
@@ -133,18 +133,18 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll
133133
<!--
134134
### Bullet lists
135135
136-
- This is a list item
137-
* This is another list item in the same list
138-
- You can mix `-` and `*`
136+
- This is a list item.
137+
* This is another list item in the same list.
138+
- You can mix `-` and `*`.
139139
- To make a sub-item, indent two spaces.
140140
- This is a sub-sub-item. Indent two more spaces.
141141
- Another sub-item.
142142
-->
143143
### 项目符号列表 {#bullet-lists}
144144

145-
- 此为列表条目
146-
* 此为另一列表条目,位于同一列表中
147-
- 你可以将 `-``*` 混合使用
145+
- 此为列表条目
146+
* 此为另一列表条目,位于同一列表中
147+
- 你可以将 `-``*` 混合使用
148148
- 要开始子列表,缩进两个空格。
149149
- 这是另一个子子条目。进一步多缩进两个空格。
150150
- 另一个子条目。
@@ -178,8 +178,8 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll
178178

179179
<!--
180180
- A bullet list item can contain a numbered list.
181-
1. Numbered sub-list item 1
182-
2. Numbered sub-list item 2
181+
1. Numbered sub-list item 1
182+
1. Numbered sub-list item 2
183183
-->
184184
- 项目符号列表条目中还可以包含编号列表。
185185
1. 编号子列表条目一
@@ -194,44 +194,41 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll
194194
<!--
195195
### Numbered lists
196196
197-
1. This is a list item
198-
2. This is another list item in the same list. The number you use in Markdown
199-
does not necessarily correlate to the number in the final output. By
200-
convention, we keep them in sync.
201-
3. {{<note>}}
202-
For single-digit numbered lists, using two spaces after the period makes
203-
interior block-level content line up better along tab-stops.
204-
{{</note>}}
197+
1. This is a list item
198+
1. This is another list item in the same list. The number you use in Markdown
199+
does not necessarily correlate to the number in the final output. By
200+
convention, we keep them in sync.
205201
-->
206202
### 编号列表 {#numbered-lists}
207203

208204
1. 此为列表条目
209-
2. 此为列表中的第二个条目。在 Markdown 源码中所给的编号数字与最终输出的数字
205+
1. 此为列表中的第二个条目。在 Markdown 源码中所给的编号数字与最终输出的数字
210206
可能不同。建议在紧凑列表中编号都使用 1。如果条目之间有其他内容(比如注释
211207
掉的英文)存在,则需要显式给出编号。
212-
3. {{<note>}}
213-
<!--
214-
For single-digit numbered lists, using two spaces after the period makes
215-
interior block-level content line up better along tab-stops.
216-
-->
217-
对于单个数字的编号列表,在句点(`.`)后面加两个空格。这样有助于将列表的
218-
内容更好地对齐。
219-
{{</note>}}
208+
209+
{{<note>}}
210+
<!--
211+
For single-digit numbered lists, using two spaces after the period makes
212+
interior block-level content line up better along tab-stops.
213+
-->
214+
对于单个数字的编号列表,在句点(`.`)后面加两个空格。这样有助于将列表的
215+
内容更好地对齐。
216+
{{</note>}}
220217

221218
<!-- separate lists -->
222219

223220
<!--
224-
1. This is a new list. With Hugo, you need to use a HTML comment to separate
225-
two consecutive lists. **The HTML comment needs to be at the left margin.**
226-
2. Numbered lists can have paragraphs or block elements within them.
221+
1. This is a new list. With Hugo, you need to use an HTML comment to separate
222+
two consecutive lists. **The HTML comment needs to be at the left margin.**
223+
1. Numbered lists can have paragraphs or block elements within them.
227224
228-
Indent the content to be the same as the first line of the bullet
229-
point. **This paragraph and the code block line up with the `N` in
230-
`Numbered` above.**
225+
Indent the content to be the same as the first line of the bullet
226+
point. **This paragraph and the code block line up with the `N` in
227+
`Numbered` above.**
231228
-->
232229
1. 这是一个新的列表。 使用 Hugo 时,你需要用 HTML 注释将两个紧挨着的列表分开。
233230
**HTML 注释需要按左边顶边对齐。**
234-
2. 编号列表条目中也可以包含额外的段落或者块元素。
231+
1. 编号列表条目中也可以包含额外的段落或者块元素。
235232

236233
后续段落应该按编号列表文字的第一行左侧对齐。
237234
**此段落及下面的代码段都与本条目中的第一个字“编”对齐。**
@@ -242,8 +239,8 @@ Markdown 在如何处理列表方面没有严格的规则。在我们从 Jekyll
242239

243240
<!--
244241
- And a sub-list after some block-level content. This is at the same
245-
"level" as the paragraph and code block above, despite being indented
246-
more.
242+
"level" as the paragraph and code block above, despite being indented
243+
more.
247244
-->
248245
- 编号列表条目中可以在块级内容之后有子列表。子列表的符号项要与上层列表条目文字左侧对齐。
249246

@@ -477,20 +474,23 @@ source for this page).
477474
## Links
478475
479476
To format a link, put the link text inside square brackets, followed by the
480-
link target in parentheses. [Link to Kubernetes.io](https://kubernetes.io/) or
481-
[Relative link to Kubernetes.io](/)
477+
link target in parentheses.
478+
479+
- `[Link to Kubernetes.io](https://kubernetes.io/)` or
480+
- `[Relative link to Kubernetes.io](/)`
482481
483482
You can also use HTML, but it is not preferred.
484-
<a href="https://kubernetes.io/">Link to Kubernetes.io</a>
483+
For example, `<a href="https://kubernetes.io/">Link to Kubernetes.io</a>`.
485484
-->
486485
## 链接 {#links}
487486

488487
要格式化链接,将链接显示文本放在方括号中,后接用圆括号括起来的链接目标。
489-
[指向 Kubernetes.io 的链接](https://kubernetes.io/)
490-
[到 Kubernetes.io 的相对链接](/)
488+
489+
- `[指向 Kubernetes.io 的链接](https://kubernetes.io/)`
490+
- `[到 Kubernetes.io 的相对链接](/)`
491491

492492
你也可以使用 HTML,但这种方式不是推荐的方式。
493-
<a href="https://kubernetes.io/">到 Kubernetes.io 的链接</a>。
493+
例如,`<a href="https://kubernetes.io/">到 Kubernetes.io 的链接</a>`
494494

495495
### 中文链接
496496

@@ -595,7 +595,7 @@ You can also use HTML for images, but it is not preferred.
595595
即使你不想使用 figure 短代码,图片也可以展示为链接。这里,铅笔图标指向
596596
Kubernetes 网站。外层的方括号将整个 image 标签封装起来,链接目标在末尾的圆括号之间给出。
597597

598-
[![pencil icon](/images/pencil.png)](https://kubernetes.io)
598+
[![铅笔图标](/images/pencil.png)](https://kubernetes.io)
599599

600600
你也可以使用 HTML 来嵌入图片,不过这种方式是不推荐的。
601601

@@ -690,7 +690,7 @@ graph TD;
690690
```
691691

692692
<!--
693-
Produces:
693+
Produces:
694694
-->
695695
会产生:
696696

@@ -742,7 +742,7 @@ sequenceDiagram
742742
```
743743

744744
<!--
745-
Produces:
745+
Produces:
746746
-->
747747
会产生:
748748

@@ -772,9 +772,9 @@ sequenceDiagram
772772
{{</ mermaid >}}
773773

774774
<!--
775-
<br>More [examples](https://mermaid-js.github.io/mermaid/#/examples) from the official docs.
775+
You can check more [examples](https://mermaid-js.github.io/mermaid/#/examples) from the official docs.
776776
-->
777-
<br>在官方网站上有更多的[示例](https://mermaid-js.github.io/mermaid/#/examples)
777+
你可以查阅官方网站上的更多[示例](https://mermaid-js.github.io/mermaid/#/examples)
778778

779779
<!--
780780
## Sidebars and Admonitions
@@ -813,6 +813,7 @@ A sidebar offsets text visually, but without the visual prominence of
813813
> ```bash
814814
> sudo dmesg
815815
> ```
816+
816817
<!--
817818
### Admonitions
818819
@@ -822,8 +823,8 @@ Admonitions (notes, warnings, etc) use Hugo shortcodes.
822823
823824
提醒框(说明、警告等等)都是用 Hugo 短代码的形式展现。
824825
825-
<!--
826826
{{< note >}}
827+
<!--
827828
Notes catch the reader's attention without a sense of urgency.
828829
829830
You can have multiple paragraphs and block-level elements inside an admonition.

0 commit comments

Comments
 (0)