---
title: "Get container logs"
method: GET
path: "/containers/{id}/logs"
tags: ["Container"]
---

# Get container logs

`GET /containers/{id}/logs`

Get `stdout` and `stderr` logs from a container.

Note: This endpoint works only for containers with the `json-file` or
`journald` logging driver.

## Path parameters

- `id` string, required

## Query parameters

- `follow` boolean
- `stdout` boolean
- `stderr` boolean
- `since` integer
- `until` integer
- `timestamps` boolean
- `tail` string

## Response `200`

logs returned as a stream in response body.
For the stream format, [see the documentation for the attach endpoint](#operation/ContainerAttach).
Note that unlike the attach endpoint, the logs endpoint does not
upgrade the connection and does not set Content-Type.

## Other responses

- `404` — no such container
- `500` — server error

---

[API](https://skmtc.net/docker/apis/docker-engine-api.md) · [All operations](https://skmtc.net/docker/apis/docker-engine-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docker/docker-engine-api/versions/a181425ed19e/schema)
