public static BackgroundTask GetTaskWithLogRecords(string taskId, DateTime startLogTime) { BackgroundTask task = GetTask(taskId); if (task == null) { return(null); } task.Logs = TaskController.GetLogs(task, startLogTime); return(task); }
private static void AddAuditLog(BackgroundTask task) { task.Logs = TaskController.GetLogs(task, task.StartDate); string executionLog = FormatExecutionLog(task); UserInfo user = UserController.GetUserInternally(task.EffectiveUserId); string username = user != null ? user.Username : null; AuditLog.AddAuditLogRecord(task.TaskId, task.Severity, task.EffectiveUserId, username, task.PackageId, task.ItemId, task.ItemName, task.StartDate, task.FinishDate, task.Source, task.TaskName, executionLog); }