diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskController.cs index 3020c56c..b6207b84 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskController.cs @@ -156,10 +156,15 @@ namespace WebsitePanel.EnterpriseServer log.Severity, log.Text, log.TextIdent, BuildParametersXml(log.TextParameters)); } - public static List GetLogs(int taskId, DateTime startLogTime) + public static List GetLogs(BackgroundTask task, DateTime startLogTime) { + if (startLogTime <= task.StartDate) + { + startLogTime = task.StartDate; + } + List logs = ObjectUtils.CreateListFromDataReader( - DataProvider.GetBackgroundTaskLogs(taskId, startLogTime)); + DataProvider.GetBackgroundTaskLogs(task.Id, startLogTime)); foreach (BackgroundTaskLogRecord log in logs) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs index ab907b60..b26a68a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs @@ -512,7 +512,7 @@ namespace WebsitePanel.EnterpriseServer if (task == null) return null; - task.Logs = TaskController.GetLogs(task.Id, startLogTime); + task.Logs = TaskController.GetLogs(task, startLogTime); return task; } @@ -600,7 +600,7 @@ namespace WebsitePanel.EnterpriseServer private static void AddAuditLog(BackgroundTask task) { - task.Logs = TaskController.GetLogs(task.Id, task.StartDate); + task.Logs = TaskController.GetLogs(task, task.StartDate); string executionLog = FormatExecutionLog(task); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/TasksTaskDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/TasksTaskDetails.ascx.cs index a985b297..24892738 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/TasksTaskDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/TasksTaskDetails.ascx.cs @@ -51,7 +51,7 @@ namespace WebsitePanel.Portal private void BindTask() { - DateTime lastLogDate = DateTime.Now.AddYears(-1); + DateTime lastLogDate = DateTime.MinValue; if (ViewState["lastLogDate"] != null) lastLogDate = (DateTime)ViewState["lastLogDate"];