---
title: "Get task logs"
method: GET
path: "/tasks/{id}/logs"
tags: ["Task"]
---

# Get task logs

`GET /tasks/{id}/logs`

Get `stdout` and `stderr` logs from a task.
See also [`/containers/{id}/logs`](#operation/ContainerLogs).

**Note**: This endpoint works only for services with the `local`,
`json-file` or `journald` logging drivers.

## Path parameters

- `id` string, required

## Query parameters

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

## Response `200`

logs returned as a stream in response body

## Other responses

- `404` — no such task
- `500` — server error
- `503` — node is not part of a swarm

---

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