> For the complete documentation index, see [llms.txt](https://run-ai-docs.nvidia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://run-ai-docs.nvidia.com/self-hosted/2.20/reference/cli/runai/runai_mpi_logs.md).

# runai mpi logs

view logs of a mpi training job

```
runai mpi logs [WORKLOAD_NAME] [flags]
```

## Examples

```
# Get logs for a mpi training
runai training mpi logs mpi-01

# Get logs for a specific pod in a mpi training
runai training mpi logs mpi-01 --pod=mpi-01-worker-0

# Get logs for a specific container in a mpi training
runai training mpi logs mpi-01 --container=mpi-worker

# Get the last 100 lines of logs
runai training mpi logs mpi-01 --tail=100

# Get logs with timestamps
runai training mpi logs mpi-01 --timestamps

# Follow the logs
runai training mpi logs mpi-01 --follow

# Get logs for the previous instance of the mpi training
runai training mpi logs mpi-01 --previous

# Limit the logs to 1024 bytes
runai training mpi logs mpi-01 --limit-bytes=1024

# Get logs since the last 5 minutes
runai training mpi logs mpi-01 --since=300s

# Get logs since a specific timestamp
runai training mpi logs mpi-01 --since-time=2023-05-30T10:00:00Z

# Wait up to 30 seconds for mpi training to be ready for logs
runai training mpi logs mpi-01 --wait-timeout=30s
```

## Options

```
  -c, --container string        Container name for log extraction
  -f, --follow                  Follow log output
  -h, --help                    help for logs
      --limit-bytes int         Limit the number of bytes returned from the server
      --name string             Set workload name for log extraction
      --pod string              Workload pod ID for log extraction, default: master (0-0)
      --previous                Show previous pod log output
  -p, --project string          Specify the project to which the command applies. By default, commands apply to the default project. To change the default project use ‘runai config project <project name>’
      --since duration          Return logs newer than a relative duration like 5s, 2m, or 3h. Defaults to all logs
      --since-time string       Return logs after a specific date (RFC3339)
  -t, --tail int                Numer of tailed lines to fetch from the log, for no limit set to -1 (default -1)
      --timestamps              Show timestamps in log output
      --wait-timeout duration   Timeout for waiting for workload to be ready for log streaming
```

## Options inherited from parent commands

```
      --config-file string   config file name; can be set by environment variable RUNAI_CLI_CONFIG_FILE (default "config.json")
      --config-path string   config path; can be set by environment variable RUNAI_CLI_CONFIG_PATH
  -d, --debug                enable debug mode
  -q, --quiet                enable quiet mode, suppress all output except error messages
      --verbose              enable verbose mode
```

## SEE ALSO

* [runai mpi](/self-hosted/2.20/reference/cli/runai/runai_mpi.md) - alias for mpi management


---

# 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://run-ai-docs.nvidia.com/self-hosted/2.20/reference/cli/runai/runai_mpi_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.
