Skip to main content
Version: IB7.0

ProcessInstances.GetInstanceLogsAsync

Description​

The API gets logs of specified process instance IDs inside the connected Control Room.

Signature [C#]​

Task<List<LogData>> GetInstanceLogsAsync(string instanceId);

Properties​

Input​

PropertyDescription
instanceIdThe process instance id for which the logs must be retrieved.

Output​

PropertyDescription
Task<List<LogData>>Returns the logs of specified process instance id.

Remarks​

Use GetInstanceLogsAsync API to get the logs of the process instance using the process instance ID inside the connected Control Room.

Example​

C#
public void GetInstanceLogs()
{
IControlRoomContext context = LoginControlRoom();

string instanceId = "e42a93f5d53245d788909fd655b41cfe";

List<LogData> logs = Task.Run(() => context.ProcessInstances.GetInstanceLogsAsync(instanceId)).Result;
foreach (LogData log in logs)
System.Console.WriteLine($"{log.TimeStamp} : {log.Message} \n");
}
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;
}