Get Job Log
[This topic contains preliminary content for the current release of Microsoft Azure.]
Gets log messages for a job.
Method |
URI |
---|---|
GET |
https://{account-name}.batchapps.core.windows.net/jobs/{jobId}/log |
Request
URL Placeholders
Parameter |
Description |
{jobId} |
The ID of the job. |
Query String Parameters
Parameter |
Description |
---|---|
since |
Optional. If specified, this must be an UTC time, and the response contains only messages since the specified time; otherwise, the response contains messages since the job was submitted. |
maxResults |
Optional. If specified, limits the number of messages returned; otherwise, an unlimited number of messages can be returned. If there are more messages than the limit, the service returns the most recent messages. |
Body
The request body must be empty.
Response
Body
The response body is a document with the following structure:
JobLog
UpTo
Messages
LogMessage*
TaskId
Timestamp
Text
Element Name |
Type |
Description |
---|---|---|
UpTo |
time |
The UTC time up to which the response contains log messages. This may be omitted if there are no log messages. |
TaskId |
integer |
The ID of the task to which the message applies. If the message refers to the job as a whole, this is 1. |
Timestamp |
time |
The time at which the message was logged. |
Text |
string |
The text of the message. |
Log messages are ordered in reverse chronological order, i.e. most recent first.
Remarks
This API returns messages logged by the framework or cloud assembly and marked as uservisible. Application executables can produce log files which tasks can capture as outputs. This API does not return these task log files. Use the List Job Tasks or List Task Outputs API to locate task log files. (Internally log messages are sometimes referred to as task feedback messages to avoid confusion with log files.)
You can use the response UpTo and request Since parameter to efficiently display a live feed of messages. The first time you request this resource, omit the Since request parameter so as to get all messages. On subsequent requests, set Since to the UpTo of the previous response. This ensures that the response will contain only new messages.