ProcessInstances.GetInstanceLogsAsync
Description
The API gets logs of specified process instance IDs inside the connected AI Command Center.
Signature [C#]
Task<List<LogData>> GetInstanceLogsAsync(string instanceId);
Properties
Input
| Parameter | Type | Required / default | Description |
|---|---|---|---|
instanceId | string | Required | The process instance id for which the logs must be retrieved. |
Output
| Property | Description |
|---|---|
| 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 AI Command Center.
Example
C#
public async Task GetInstanceLogs()
{
IControlRoomContext context = LoginControlRoom();
try
{
string instanceId = "e42a93f5d53245d788909fd655b41cfe";
List<LogData> logs = await context.ProcessInstances.GetInstanceLogsAsync(instanceId);
foreach (LogData log in logs)
System.Console.WriteLine($"{log.TimeStamp} : {log.Message} \n");
}
finally
{
context.Close();
}
}
Connection helper
public IControlRoomContext LoginControlRoom()
{
string RequiredSetting(string name) => Environment.GetEnvironmentVariable(name) ?? throw new InvalidOperationException($"Set {name} before running this example.");
string serverUrl = RequiredSetting("INTELLIBUDDIES_SERVER_URL");
string userName = RequiredSetting("INTELLIBUDDIES_USERNAME");
string password = RequiredSetting("INTELLIBUDDIES_PASSWORD");
string connectionString = $"ServerUrl={serverUrl};UserName={userName};Password={password}";
IControlRoomContext context = new ControlRoomContext(connectionString);
context.Open();
return context;
}
See Get started for namespaces, configuration, and context cleanup, and SDK usage for error handling.