Logs.GetLogsByBotId
Description
The API gets the list of log details of all jobs from the specified SmartBuddy Id from the connected Control Room.
Signature [C#]
Task<List<LogData>> GetLogsByBotId(int botId, int skip, int take)
Properties
Input
Property | Description |
---|---|
botId | Specify the SmartBuddy Id to retrieve log information. |
skip | Specify the number of log details in a sequence to be skipped, by returning the remaining log details. |
take | Specify the number of contiguous log details from the start of a sequence. |
Output
Property | Description |
---|---|
Task<List<LogData>> | Returns log details of jobs from the specified SmartBuddy. |
Remarks
Use GetLogsByBotId API to get the list of logs of all jobs from the specified SmartBuddy id and the pagination parameters (take and skip) from the connected Control Room.
Example
C#
public void GetLogByBotId()
{
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;
}