Logs.GetLogsByJobId
Description
The API gets the list of log details of all jobs from the specified job Id from the connected Control Room.
Signature [C#]
Task<List<LogData>> GetLogsByJobId(int jobId)
Properties
Input
Property | Description |
---|---|
jobId | Specify the job Id to retrieve log information. |
Output
Property | Description |
---|---|
Task<List<LogData>> | Returns the log details of a job. |
Remarks
Use GetLogsByJobId API to get the list of log details of specified log Id from the connected Control Room.
Example
C#
public void GetLogsByJobId()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");
int jobId = 1;
var logs = Task.Run(() => context.Logs.GetLogsByJobId(jobId)).Result;
foreach (LogData logData in logs)
System.Console.WriteLine(logData.Message);
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;
connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);
context.Open();
return context;
}