> For the complete documentation index, see [llms.txt](https://docs.omics.ai/products/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.omics.ai/products/command-line-interface/reference/workbench/runs-logs.md).

# runs logs

Retrieve log bytes for a run or a task

## Synopsis

```shell
omics workbench runs logs [RUN_ID|LOG_URL]
  [--max-bytes=NUMBER]
  [--offset=NUMBER]
  [--log-type=LOG_TYPE]
  [--task-id=TASK_ID]
  [--output=PATH] 
```

## Description

Retrieve log bytes for a run or a task and stream to the console. The content of Run level logs are engine and environment dependent and may not always be present.Task-level logs often contain the log output generated from the execution of the task itself and can be helpful for debugging a task.

## Examples

Retrieve the workflow level `stdout` logs for a given run and print it to the console.

```shell
omics workbench runs logs e5ed2c8f-d570-42db-a897-0861d7f828d2
```

You can easily switch to streaming the stderr logs instead of the `stderr`.

```shell
omics workbench runs logs --log-type stderr e5ed2c8f-d570-42db-a897-0861d7f828d2
```

If you would like to retrieve the logs for a given task, you first will need the `task_id`. The `task_id` can be retrieved using the [runs tasks list](/products/command-line-interface/reference/workbench/runs-tasks-list.md) command:

```shell
TASK_ID=$(omics workbench runs tasks list --run e5ed2c8f-d570-42db-a897-0861d7f828d2 | jq '[.tasks[] | .task_id][0]')
```

Once you have the `task_id`, you can then use it in the logs command to retrieve the task level logs.

```shell
omics workbench runs logs --task-id "${TASK_ID}" e5ed2c8f-d570-42db-a897-0861d7f828d2
```

## Positional Flags

### `[RUN_ID|LOGURL]`

## Flags

### `--max-bytes`=`NUMBER`

Limit the number of bytes to retrieve from the log stream.

### `--offset`=`NUMBER`

Skip over `N` bytes in the log-stream, allowing you to jump into a random part of the log.

### `--log-type`=`LOG_TYPE`

Toggle whether to write the associated `stderr` or `stdout` to the output. If this value flag is not specified the default is `stdout`.

Valid choices: `stdout`, `stderr`

### `--task-id`=`TASK_ID`

If specified, retrieve the logs for a given task within a run. The `task_id` can be retrieved from the [runs tasks list](/products/command-line-interface/reference/workbench/runs-tasks-list.md) command.

### `--output`=`PATH`

If specified, attempt to write the stderr or stdout logs to the given file path. If the file exists, the command will exit without overwriting it.

In order to get the logs for a specific task, you can first use the `runs tasks list` command to retrieve a list of task IDs. tasks?


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.omics.ai/products/command-line-interface/reference/workbench/runs-logs.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
