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-cn/docs/concepts/cluster-administration/system-logs.md
+43-35Lines changed: 43 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,9 @@ weight: 80
17
17
<!--
18
18
System component logs record events happening in cluster, which can be very useful for debugging.
19
19
You can configure log verbosity to see more or less detail.
20
-
Logs can be as coarse-grained as showing errors within a component, or as fine-grained as showing step-by-step traces of events (like HTTP access logs, pod state changes, controller actions, or scheduler decisions).
20
+
Logs can be as coarse-grained as showing errors within a component, or as fine-grained as showing
21
+
step-by-step traces of events (like HTTP access logs, pod state changes, controller actions, or
22
+
scheduler decisions).
21
23
-->
22
24
系统组件的日志记录集群中发生的事件,这对于调试非常有用。
23
25
你可以配置日志的精细度,以展示更多或更少的细节。
@@ -34,16 +36,16 @@ generates log messages for the Kubernetes system components.
34
36
35
37
For more information about klog configuration, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
Migration to structured log messages is an ongoing process. Not all log messages are structured in this version. When parsing log files, you must also handle unstructured log messages.
144
+
Migration to structured log messages is an ongoing process. Not all log messages are structured in
145
+
this version. When parsing log files, you must also handle unstructured log messages.
144
146
145
147
Log formatting and value serialization are subject to change.
146
148
-->
@@ -151,17 +153,18 @@ Log formatting and value serialization are subject to change.
151
153
{{< /warning>}}
152
154
153
155
<!--
154
-
Structured logging introduces a uniform structure in log messages allowing for programmatic extraction of information. You can store and process structured logs with less effort and cost.
155
-
The code which generates a log message determines whether it uses the traditional unstructured klog output
156
-
or structured logging.
156
+
Structured logging introduces a uniform structure in log messages allowing for programmatic
157
+
extraction of information. You can store and process structured logs with less effort and cost.
158
+
The code which generates a log message determines whether it uses the traditional unstructured
159
+
klog output or structured logging.
157
160
-->
158
161
结构化日志记录旨在日志消息中引入统一结构,以便以编程方式提取信息。
159
162
你可以方便地用更小的开销来处理结构化日志。
160
163
生成日志消息的代码决定其使用传统的非结构化的 klog 还是结构化的日志。
161
164
162
165
<!--
163
-
The default formatting of structured log messages is as text, with a format that
164
-
is backward compatible with traditional klog:
166
+
The default formatting of structured log messages is as text, with a format that is backward
JSON output does not support many standard klog flags. For list of unsupported klog flags, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
283
+
JSON output does not support many standard klog flags. For list of unsupported klog flags, see the
284
+
[Command line tool reference](/docs/reference/command-line-tools-reference/).
281
285
282
-
Not all logs are guaranteed to be written in JSON format (for example, during process start). If you intend to parse logs, make sure you can handle log lines that are not JSON as well.
286
+
Not all logs are guaranteed to be written in JSON format (for example, during process start).
287
+
If you intend to parse logs, make sure you can handle log lines that are not JSON as well.
283
288
284
289
Field names and JSON serialization are subject to change.
285
290
-->
@@ -298,6 +303,7 @@ Example of JSON log format (pretty printed):
@@ -337,10 +344,11 @@ List of components currently supporting JSON format:
337
344
<!--
338
345
### Log verbosity level
339
346
340
-
The `-v` flag controls log verbosity. Increasing the value increases the number of logged events. Decreasing the value decreases the number of logged events.
341
-
Increasing verbosity settings logs increasingly less severe events. A verbosity setting of 0 logs only critical events.
347
+
The `-v` flag controls log verbosity. Increasing the value increases the number of logged events.
348
+
Decreasing the value decreases the number of logged events. Increasing verbosity settings logs
349
+
increasingly less severe events. A verbosity setting of 0 logs only critical events.
342
350
-->
343
-
### 日志精细度级别
351
+
### 日志精细度级别 {#log-verbosity-level}
344
352
345
353
参数 `-v` 控制日志的精细度。增大该值会增大日志事件的数量。
346
354
减小该值可以减小日志事件的数量。增大精细度会记录更多的不太严重的事件。
@@ -356,7 +364,7 @@ that do not run in a container. For example:
356
364
* The kubelet and {{<glossary_tooltip term_id="container-runtime" text="container runtime">}}
357
365
do not run in containers.
358
366
-->
359
-
### 日志位置
367
+
### 日志位置 {#log-location}
360
368
361
369
有两种类型的系统组件:运行在容器中的组件和不运行在容器中的组件。例如:
362
370
@@ -377,7 +385,7 @@ The `logrotate` tool rotates logs daily, or once the log size is greater than 10
0 commit comments