Skip to content

Commit 1e3b4d3

Browse files
committed
Clarify that some logging options are already dropped
1 parent 6aa1f9d commit 1e3b4d3

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ If systemd is not present, the kubelet and container runtime write to `.log` fil
149149
run the kubelet via a helper tool, `kube-log-runner`, and use that tool to redirect
150150
kubelet logs to a directory that you choose.
151151

152-
You can also set a logging directory using the deprecated kubelet command line
153-
argument `--log-dir`. However, the kubelet always directs your container runtime to
154-
write logs into directories within `/var/log/pods`.
152+
The kubelet always directs your container runtime to write logs into directories within
153+
`/var/log/pods`.
155154

156155
For more information on `kube-log-runner`, read [System Logs](/docs/concepts/cluster-administration/system-logs/#klog).
157156

content/en/docs/concepts/cluster-administration/system-logs.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ scheduler decisions).
2222
klog is the Kubernetes logging library. [klog](https://github.com/kubernetes/klog)
2323
generates log messages for the Kubernetes system components.
2424

25-
For more information about klog configuration, see the [Command line tool reference](/docs/reference/command-line-tools-reference/).
26-
2725
Kubernetes is in the process of simplifying logging in its components.
2826
The following klog command line flags
2927
[are deprecated](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
30-
starting with Kubernetes 1.23 and will be removed in a future release:
28+
starting with Kubernetes 1.23 and removed in 1.26:
3129

3230
- `--add-dir-header`
3331
- `--alsologtostderr`
@@ -96,13 +94,13 @@ klog output or structured logging.
9694
The default formatting of structured log messages is as text, with a format that is backward
9795
compatible with traditional klog:
9896

99-
```ini
97+
```
10098
<klog header> "<message>" <key1>="<value1>" <key2>="<value2>" ...
10199
```
102100

103101
Example:
104102

105-
```ini
103+
```
106104
I1025 00:15:15.525108 1 controller_utils.go:116] "Pod status updated" pod="kube-system/kubedns" status="ready"
107105
```
108106

@@ -245,13 +243,15 @@ in the application log provider. On both operating systems, logs are also availa
245243

246244
Provided you are authorized to interact with node objects, you can try out this alpha feature on all your nodes or
247245
just a subset. Here is an example to retrieve the kubelet service logs from a node:
246+
248247
```shell
249248
# Fetch kubelet logs from a node named node-1.example
250249
kubectl get --raw "/api/v1/nodes/node-1.example/proxy/logs/?query=kubelet"
251250
```
252251

253252
You can also fetch files, provided that the files are in a directory that the kubelet allows for log
254253
fetches. For example, you can fetch a log from `/var/log` on a Linux node:
254+
255255
```shell
256256
kubectl get --raw "/api/v1/nodes/<insert-node-name-here>/proxy/logs/?query=/<insert-log-file-name-here>"
257257
```
@@ -273,6 +273,7 @@ Option | Description
273273
`tailLines` | specify how many lines from the end of the log to retrieve; the default is to fetch the whole log
274274

275275
Example of a more complex query:
276+
276277
```shell
277278
# Fetch kubelet logs from a node named node-1.example that have the word "error"
278279
kubectl get --raw "/api/v1/nodes/node-1.example/proxy/logs/?query=kubelet&pattern=error"

0 commit comments

Comments
 (0)