> 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

## 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
