Skip to content

Commit

Permalink
Apply some line wrapping cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tengqm committed Jun 3, 2023
1 parent 1e3b4d3 commit 60dc217
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
28 changes: 17 additions & 11 deletions content/en/docs/concepts/cluster-administration/logging.md
Expand Up @@ -71,11 +71,12 @@ You can use `kubectl logs --previous` to retrieve logs from a previous instantia
If your pod has multiple containers, specify which container's logs you want to access by
appending a container name to the command, with a `-c` flag, like so:

```console
```shell
kubectl logs counter -c count
```

See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs) for more details.
See the [`kubectl logs` documentation](/docs/reference/generated/kubectl/kubectl-commands#logs)
for more details.

### How nodes handle container logs

Expand All @@ -98,23 +99,23 @@ The usual way to access this is by running `kubectl logs`.

You can configure the kubelet to rotate logs automatically.

If you configure rotation, the kubelet is responsible for rotating container logs and managing the logging directory structure.
If you configure rotation, the kubelet is responsible for rotating container logs and managing the
logging directory structure.
The kubelet sends this information to the container runtime (using CRI),
and the runtime writes the container logs to the given location.

You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/),
`containerLogMaxSize` and `containerLogMaxFiles`,
using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/).
These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively.
These settings let you configure the maximum size for each log file and the maximum number of
files allowed for each container respectively.

When you run [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands#logs) as in
the basic logging example, the kubelet on the node handles the request and
reads directly from the log file. The kubelet returns the content of the log file.


{{< note >}}
Only the contents of the latest log file are available through
`kubectl logs`.
Only the contents of the latest log file are available through `kubectl logs`.

For example, if a Pod writes 40 MiB of logs and the kubelet rotates logs
after 10 MiB, running `kubectl logs` returns at most 10MiB of data.
Expand Down Expand Up @@ -220,7 +221,8 @@ application containers on that node.
Because the logging agent must run on every node, it is recommended to run the agent
as a `DaemonSet`.

Node-level logging creates only one agent per node and doesn't require any changes to the applications running on the node.
Node-level logging creates only one agent per node and doesn't require any changes to the
applications running on the node.

Containers write to stdout and stderr, but with no agreed format. A node-level agent collects
these logs and forwards them for aggregation.
Expand All @@ -230,7 +232,8 @@ these logs and forwards them for aggregation.
You can use a sidecar container in one of the following ways:

* The sidecar container streams application logs to its own `stdout`.
* The sidecar container runs a logging agent, which is configured to pick up logs from an application container.
* The sidecar container runs a logging agent, which is configured to pick up logs
from an application container.

#### Streaming sidecar container

Expand Down Expand Up @@ -345,10 +348,13 @@ The pod mounts a volume where fluentd can pick up its configuration data.

![Exposing logs directly from the application](/images/docs/user-guide/logging/logging-from-application.png)

Cluster-logging that exposes or pushes logs directly from every application is outside the scope of Kubernetes.
Cluster-logging that exposes or pushes logs directly from every application is outside the scope
of Kubernetes.

## {{% heading "whatsnext" %}}

* Read about [Kubernetes system logs](/docs/concepts/cluster-administration/system-logs/)
* Learn about [Traces For Kubernetes System Components](/docs/concepts/cluster-administration/system-traces/)
* 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
* 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

Expand Up @@ -25,7 +25,7 @@ generates log messages for the Kubernetes system components.
Kubernetes is in the process of simplifying logging in its components.
The following klog command line flags
[are deprecated](https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components)
starting with Kubernetes 1.23 and removed in 1.26:
starting with Kubernetes v1.23 and removed in Kubernetes v1.26:

- `--add-dir-header`
- `--alsologtostderr`
Expand Down

0 comments on commit 60dc217

Please sign in to comment.