using System; using System.Data; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using CMS.GlobalHelper; using CMS.SettingsProvider; using CMS.UIControls; public partial class CMSModules_System_Debug_System_DebugWebFarm : CMSDebugPage { protected void Page_Load(object sender, EventArgs e) { btnClear.Text = GetString("DebugWebFarm.ClearLog"); ReloadData(); } protected void ReloadData() { if (!WebSyncHelperClass.DebugWebFarm) { ShowWarning(GetString("DebugWebFarm.NotConfigured"), null, null); } else { plcLogs.Controls.Clear(); for (int i = WebSyncHelperClass.LastLogs.Count - 1; i >= 0; i--) { try { // Get the log RequestLog log = (RequestLog)WebSyncHelperClass.LastLogs[i]; if (log != null) { // Load the table DataTable dt = log.LogTable; if (!DataHelper.DataSourceIsEmpty(dt)) { // Load the control WebFarmLog logCtrl = (WebFarmLog)LoadUserControl("~/CMSAdminControls/Debug/WebFarmLog.ascx"); logCtrl.ID = "logSQL" + i; logCtrl.EnableViewState = false; logCtrl.Log = log; logCtrl.DisplayHeader = false; // Add to the output plcLogs.Controls.Add(new LiteralControl("
 " + GetRequestLink(log.RequestURL, log.RequestGUID) + " (" + log.RequestTime.ToString("hh:mm:ss") + ")‎

")); plcLogs.Controls.Add(logCtrl); plcLogs.Controls.Add(new LiteralControl("


")); } } } catch { } } } } protected void btnClear_Click(object sender, EventArgs e) { WebSyncHelperClass.LastLogs.Clear(); ReloadData(); } }