# Docker

The HCloud Docker agents log can be retrieved like any container log in Docker.

Type

```sh
sudo docker stats
```

to get a list of all your containers, then pick the name of the client container which you want to read the logfiles of.

Alternatively, search for a string to reduce the number of line output and get only lines with the hcloud-string in it.

```sh
sudo docker stats | grep -i hcloud
```

Copy the name of the agents container affected and type

```sh
sudo docker logs hcloudagentcontainername
```

to retrieve the logs, or write them into a file like this:

<pre class="language-sh"><code class="lang-sh"><strong>sudo docker logs hcloudagentcontainername > /path/to/mylogfile.log
</strong></code></pre>

Like with any container, you can use third party tools to automatically collect logs and process or visualize information from your agents that are running as containers. You can also use helmut.cloud to collect and distribute logfiles to a location of your liking.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.helmut.cloud/the-helmut.cloud-agent/helmut.cloud-agent-logs/docker.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
