Delen via


Logs - Append Log Content

Append a log to a task's log. The log should be sent in the body of the request as a TaskLog object stream.

POST https://dev.azure.com/{organization}/{scopeIdentifier}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/logs/{logId}?api-version=7.1

URI Parameters

Name In Required Type Description
hubName
path True

string

The name of the server hub. Common examples: "build", "rm", "checks"

logId
path True

integer

int32

The ID of the log.

organization
path True

string

The name of the Azure DevOps organization.

planId
path True

string

uuid

The ID of the plan.

scopeIdentifier
path True

string

uuid

The project GUID to scope the request

api-version
query True

string

Version of the API to use. This should be set to '7.1' to use this version of the api.

Request Body

Media Types: "application/octet-stream"

Name Type Description
body

string

Stream to upload

Responses

Name Type Description
200 OK

TaskLog

successful operation

Security

accessToken

Personal access token. Use any value for the user name and the token as the password.

Type: basic

Examples

Append content to a log

Sample request

POST https://dev.azure.com/{organization}/{scopeIdentifier}/_apis/distributedtask/hubs/{hubName}/plans/{planId}/logs/{logId}?api-version=7.1

Sample response

{
  "path": "logs\\5e6d5dbf-ac69-5f56-8b85-8e9038703a8b",
  "lineCount": 36,
  "createdOn": "2022-12-02T09:33:14.873Z",
  "lastChangedOn": "2022-12-02T09:49:22.097Z",
  "id": 3,
  "location": null
}

Definitions

TaskLog

A task log connected to a timeline record.

Name Type Description
createdOn

string

The time of the task log creation.

id

integer

The ID of the task log.

indexLocation

string

The REST URL of the task log when indexed.

lastChangedOn

string

The time of the last modification of the task log.

lineCount

integer

The number of the task log lines.

location

string

The REST URL of the task log.

path

string

The path of the task log.