Skip to main content
Both Endpoints and Worker Groups keep logs that can be fetched by using the /get_endpoint_logs/ and /get_autogroup_logs/ endpoints, respectively. Endpoint logs relate to managing instances, and Worker Group logs relate to searching for offers to create instances from, as well as calls to create instances using the offers. For both types of groups, there are four levels of logs with decreasing levels of detail: debug, trace, info0, and info1.
Each log level has a fixed size, and once it is full, the log is wiped and overwritten with new log messages. It is good practice to check these regularly while debugging.

Using the CLI

You can use the vastai CLI to quickly check endpoint and worker group logs at different log levels.

Endpoint logs

CLI Command
vastai get endpt-logs <endpoint_id> --level (0-3)

Workergroup logs

CLI Command
vastai get wrkgrp-logs <worker_group_id> --level (0-3)

POST https://run.vast.ai/get_endpoint_logs/

Inputs

  • One of the following:
    • id(int): ID of your endpoint
    • endpoint(string): Name of your endpoint
  • api_key(string): The Vast API key associated with the account that controls the Endpoint.
  • tail (int): The number of bytes from the end of each log file that will be sent in the response.
    • If the file size is less than or equal to tail, then the whole file will be returned.
    • A value of -1 will return the whole file.
JSON
{
    "endpoint": "YOUR_ENDPOINT_NAME",
    "api_key": "YOUR_VAST_API_KEY",
    "tail": 1000
}

Outputs

If tail has a value of 1000
JSON
{
  "info0": "Last l000 bytes of the info0 log",
  "info1": "Last l000 bytes of the info0 log",
  "trace": "Last l000 bytes of the trace log",
  "debug": "Last l000 bytes of the debug log"
}

Example: Fetching Endpoint Logs with cURL

Curl
curl https://run.vast.ai/get_endpoint_logs/ \
-X POST \
-d '{"endpoint" : 123, "api_key" : "API_KEY_HERE"}' \
-H 'Content-Type: application/json'

POST https://run.vast.ai/get_autogroup_logs/

Inputs

  • id(int): The ID of the Worker Group
  • api_key(string): The Vast API key associated with the account that controls the Worker Group.
  • tail (int): The number of bytes from the end of each log file that will be sent in the response.
    • If the file size is less than or equal to tail, then the whole file will be returned.
    • A value of -1 will return the whole file.
JSON
{
    "id": 1001,
    "api_key": "YOUR_VAST_API_KEY",
    "tail": 1000
}

Outputs

If the value of tail is 1000
JSON
{
  "info0": "Last l000 bytes of the info0 log",
  "info1": "Last l000 bytes of the info0 log",
  "trace": "Last l000 bytes of the trace log",
  "debug": "Last l000 bytes of the debug log"
}

Example: Fetching Worker Group Logs with cURL

Bash
curl https://run.vast.ai/get_autogroup_logs/ \
-X POST \
-d '{"id" : 1001, "api_key" : "API_KEY_HERE"}' \
-H 'Content-Type: application/json'
In some cases info0 may not contain logs for a Worker Group.