Skip to main content
Version: Current

Logs.GetLogsByJobId

Description​

The API gets the list of log details of all jobs from the specified job Id from the connected AI Command Center.

Signature [C#]​

Task<List<LogData>> GetLogsByJobId(int jobId);

Properties​

Input​

ParameterTypeRequired / defaultDescription
jobIdintRequiredSpecify the job Id to retrieve log information.

Output​

PropertyDescription
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 AI Command Center.

Example​

C#
public async Task GetLogsByJobId()
{
IControlRoomContext context = LoginControlRoom();
try
{
int jobId = 1;
var logs = await context.Logs.GetLogsByJobId(jobId);
foreach (LogData logData in logs)
System.Console.WriteLine(logData.Message);
}
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.