• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# EventLog.LogController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DotNetNuke.Services.Log.EventLog.LogController的典型用法代码示例。如果您正苦于以下问题:C# LogController类的具体用法?C# LogController怎么用?C# LogController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LogController类属于DotNetNuke.Services.Log.EventLog命名空间,在下文中一共展示了LogController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Log404

        /// <summary>
        /// Logs the 404 error to a table for later checking 
        /// </summary>
        /// <param name="request"></param>
        /// <param name="settings"></param>
        /// <param name="result"></param>
        public static void Log404(HttpRequest request, FriendlyUrlSettings settings, UrlAction result)
        {
            var controller = new LogController();
            var log = new LogInfo
                {
                    LogTypeKey = EventLogController.EventLogType.PAGE_NOT_FOUND_404.ToString(),
                    LogPortalID = (result.PortalAlias != null) ? result.PortalId : -1
                };
            log.LogProperties.Add(new LogDetailInfo("TabId", (result.TabId > 0) ? result.TabId.ToString() : String.Empty));
            log.LogProperties.Add(new LogDetailInfo("PortalAlias",  (result.PortalAlias != null) ? result.PortalAlias.HTTPAlias : String.Empty));
            log.LogProperties.Add(new LogDetailInfo("OriginalUrl",  result.RawUrl));

            if (request != null)
            {
                if (request.UrlReferrer != null)
                {
                    log.LogProperties.Add(new LogDetailInfo("Referer", request.UrlReferrer.AbsoluteUri));
                }
                log.LogProperties.Add(new LogDetailInfo("Url", request.Url.AbsoluteUri));
                log.LogProperties.Add(new LogDetailInfo("UserAgent", request.UserAgent));
                log.LogProperties.Add(new LogDetailInfo("HostAddress", request.UserHostAddress));
                log.LogProperties.Add(new LogDetailInfo("HostName", request.UserHostName));
            }

            controller.AddLog(log);
        }
开发者ID:uXchange,项目名称:Dnn.Platform,代码行数:32,代码来源:UrlRewriterUtils.cs


示例2: BindLogTypeDropDown

        private void BindLogTypeDropDown()
        {
            //ddlLogType.Items.Add(new ListItem(Localization.GetString("All"), "*"));
            ddlLogType.AddItem(Localization.GetString("All"), "*");
            var logController = new LogController();

            List<LogTypeConfigInfo> logTypes;
            if (String.IsNullOrEmpty(EventFilter))
            {
                logTypes = logController.GetLogTypeConfigInfo().Cast<LogTypeConfigInfo>()
                    .Where(l => l.LoggingIsActive)
                    .OrderBy(l => l.LogTypeFriendlyName).ToList();
            }
            else
            {
                logTypes = logController.GetLogTypeConfigInfo().Cast<LogTypeConfigInfo>()
                    .Where(l => l.LogTypeKey.StartsWith(EventFilter) && l.LoggingIsActive)
                    .OrderBy(l => l.LogTypeFriendlyName).ToList();
            }

            foreach (var logType in logTypes)
            {
                //ddlLogType.Items.Add(new ListItem(logType.LogTypeFriendlyName, logType.LogTypeKey));
                ddlLogType.AddItem(logType.LogTypeFriendlyName, logType.LogTypeKey);
            }
        }
开发者ID:RichardHowells,项目名称:dnnextensions,代码行数:26,代码来源:LogViewer.ascx.cs


示例3: GetData

        public override object GetData(ITabContext context)
        {
            try
            {
                var portalSettings = PortalSettings.Current;

                int totalRecords = 0;
                LogInfoArray logs = new LogController().GetLog(portalSettings.PortalId, 15, 0, ref totalRecords);

                if (logs.Count == 0)
                    return null;

                var data = new List<object[]> {new object[] {"Created Date", "Log Type", "UserName", "Content"}};
                for (int i = 0; i < logs.Count; i++)
                {
                    var log = logs.GetItem(i);

                    var logProperties = new List<object[]> {new object[] {"Property", "Value"}};
                    for (int j = 0; j < log.LogProperties.Count; j++)
                    {
                        var logDetail = (LogDetailInfo)log.LogProperties[j];
                        logProperties.Add(new object[] { logDetail.PropertyName, logDetail.PropertyValue });
                    }

                    data.Add(new object[] {log.LogCreateDate, log.LogTypeKey, log.LogUserName, logProperties});
                }

                return data;
            }
            catch (Exception ex)
            {
                Exceptions.LogException(ex);
                return "There was an error loading the data for this tab";
            }
        }        
开发者ID:jbrinkman,项目名称:DotNetNuke.Extensions.Glimpse,代码行数:35,代码来源:DNNLogViewerPlugin.cs


示例4: AddLog

        public void AddLog(Exception objException, ExceptionLogType LogType)
        {
            var objLogController = new LogController();
            var objLogInfo = new LogInfo();
            objLogInfo.LogTypeKey = LogType.ToString();
            if (LogType == ExceptionLogType.SEARCH_INDEXER_EXCEPTION)
            {
				//Add SearchException Properties
                var objSearchException = (SearchException) objException;
                objLogInfo.LogProperties.Add(new LogDetailInfo("ModuleId", objSearchException.SearchItem.ModuleId.ToString()));
                objLogInfo.LogProperties.Add(new LogDetailInfo("SearchItemId", objSearchException.SearchItem.SearchItemId.ToString()));
                objLogInfo.LogProperties.Add(new LogDetailInfo("Title", objSearchException.SearchItem.Title));
                objLogInfo.LogProperties.Add(new LogDetailInfo("SearchKey", objSearchException.SearchItem.SearchKey));
                objLogInfo.LogProperties.Add(new LogDetailInfo("GUID", objSearchException.SearchItem.GUID));
            }
            else if (LogType == ExceptionLogType.MODULE_LOAD_EXCEPTION)
            {
				//Add ModuleLoadException Properties
                var objModuleLoadException = (ModuleLoadException) objException;
                objLogInfo.LogProperties.Add(new LogDetailInfo("ModuleId", objModuleLoadException.ModuleId.ToString()));
                objLogInfo.LogProperties.Add(new LogDetailInfo("ModuleDefId", objModuleLoadException.ModuleDefId.ToString()));
                objLogInfo.LogProperties.Add(new LogDetailInfo("FriendlyName", objModuleLoadException.FriendlyName));
                objLogInfo.LogProperties.Add(new LogDetailInfo("ModuleControlSource", objModuleLoadException.ModuleControlSource));
            }
            else if (LogType == ExceptionLogType.SECURITY_EXCEPTION)
            {
				//Add SecurityException Properties
                var objSecurityException = (SecurityException) objException;
                objLogInfo.LogProperties.Add(new LogDetailInfo("Querystring", objSecurityException.Querystring));
                objLogInfo.LogProperties.Add(new LogDetailInfo("IP", objSecurityException.IP));
            }
			
			//Add BasePortalException Properties
            var objBasePortalException = new BasePortalException(objException.ToString(), objException);
            objLogInfo.LogProperties.Add(new LogDetailInfo("AssemblyVersion", objBasePortalException.AssemblyVersion));
            objLogInfo.LogProperties.Add(new LogDetailInfo("PortalID", objBasePortalException.PortalID.ToString()));
            objLogInfo.LogProperties.Add(new LogDetailInfo("PortalName", objBasePortalException.PortalName));
            objLogInfo.LogProperties.Add(new LogDetailInfo("UserID", objBasePortalException.UserID.ToString()));
            objLogInfo.LogProperties.Add(new LogDetailInfo("UserName", objBasePortalException.UserName));
            objLogInfo.LogProperties.Add(new LogDetailInfo("ActiveTabID", objBasePortalException.ActiveTabID.ToString()));
            objLogInfo.LogProperties.Add(new LogDetailInfo("ActiveTabName", objBasePortalException.ActiveTabName));
            objLogInfo.LogProperties.Add(new LogDetailInfo("RawURL", objBasePortalException.RawURL));
            objLogInfo.LogProperties.Add(new LogDetailInfo("AbsoluteURL", objBasePortalException.AbsoluteURL));
            objLogInfo.LogProperties.Add(new LogDetailInfo("AbsoluteURLReferrer", objBasePortalException.AbsoluteURLReferrer));
            objLogInfo.LogProperties.Add(new LogDetailInfo("UserAgent", objBasePortalException.UserAgent));
            objLogInfo.LogProperties.Add(new LogDetailInfo("DefaultDataProvider", objBasePortalException.DefaultDataProvider));
            objLogInfo.LogProperties.Add(new LogDetailInfo("ExceptionGUID", objBasePortalException.ExceptionGUID));
            objLogInfo.LogProperties.Add(new LogDetailInfo("InnerException", objBasePortalException.InnerException.Message));
            objLogInfo.LogProperties.Add(new LogDetailInfo("FileName", objBasePortalException.FileName));
            objLogInfo.LogProperties.Add(new LogDetailInfo("FileLineNumber", objBasePortalException.FileLineNumber.ToString()));
            objLogInfo.LogProperties.Add(new LogDetailInfo("FileColumnNumber", objBasePortalException.FileColumnNumber.ToString()));
            objLogInfo.LogProperties.Add(new LogDetailInfo("Method", objBasePortalException.Method));
            objLogInfo.LogProperties.Add(new LogDetailInfo("StackTrace", objBasePortalException.StackTrace));
            objLogInfo.LogProperties.Add(new LogDetailInfo("Message", objBasePortalException.Message));
            objLogInfo.LogProperties.Add(new LogDetailInfo("Source", objBasePortalException.Source));
            objLogInfo.LogPortalID = objBasePortalException.PortalID;
            objLogController.AddLog(objLogInfo);
        }
开发者ID:biganth,项目名称:Curt,代码行数:58,代码来源:ExceptionLogController.cs


示例5: GetData

        /// <summary>
        /// Gets the data to send to the Glimpse client.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <returns>Data to send the the Glimpse client.</returns>
        public object GetData(HttpContextBase context)
        {
            try
            {
                var portalSettings = PortalSettings.Current;

                // get the logs
                int totalRecords = 0;
                LogInfoArray logs = new LogController().GetLog(portalSettings.PortalId, 15, 1, ref totalRecords);

                // bail if we don't have any
                if (logs.Count == 0)
                    return null;

                // add to data to send
                var data = new List<object[]> {new object[] {"Created Date", "Log Type", "UserName", "Content"}};
                for (int i = 0; i < logs.Count; i++)
                {
                    var log = logs.GetItem(i);

                    // get log properties 
                    var logProperties = new List<object[]> {new object[] {"Property", "Value"}};
                    for (int j = 0; j < log.LogProperties.Count; j++)
                    {
                        var logDetail = log.LogProperties[j] as LogDetailInfo;
                        logProperties.Add(new object[] {logDetail.PropertyName, logDetail.PropertyValue});
                    }

                    data.Add(new object[] {log.LogCreateDate, log.LogTypeKey, log.LogUserName, logProperties});
                }

                return data;
            }
            catch (Exception ex)
            {
                DotNetNuke.Services.Exceptions.Exceptions.LogException(ex);
                return null;
            }
        }        
开发者ID:JonHaywood,项目名称:DotNetNuke.Extensions.Glimpse,代码行数:44,代码来源:DNNLogViewerPlugin.cs


示例6: dgLogTypeConfigInfo_EditCommand

        protected void dgLogTypeConfigInfo_EditCommand(object source, DataGridCommandEventArgs e)
        {
            var LogID = Convert.ToString(dgLogTypeConfigInfo.DataKeys[e.Item.ItemIndex]);
            ViewState["LogID"] = LogID;

            BindDetailData();

            var l = new LogController();

            LogTypeConfigInfo objLogTypeConfigInfo = l.GetLogTypeConfigInfoByID(LogID);

            chkIsActive.Checked = objLogTypeConfigInfo.LoggingIsActive;
            chkEmailNotificationStatus.Checked = objLogTypeConfigInfo.EmailNotificationIsActive;

            if (ddlLogTypeKey.Items.FindByValue(objLogTypeConfigInfo.LogTypeKey) != null)
            {
                ddlLogTypeKey.ClearSelection();
                ddlLogTypeKey.Items.FindByValue(objLogTypeConfigInfo.LogTypeKey).Selected = true;
            }
            if (ddlLogTypePortalID.Items.FindByValue(objLogTypeConfigInfo.LogTypePortalID) != null)
            {
                ddlLogTypePortalID.ClearSelection();
                ddlLogTypePortalID.Items.FindByValue(objLogTypeConfigInfo.LogTypePortalID).Selected = true;
            }
            if (ddlKeepMostRecent.Items.FindByValue(objLogTypeConfigInfo.KeepMostRecent) != null)
            {
                ddlKeepMostRecent.ClearSelection();
                ddlKeepMostRecent.Items.FindByValue(objLogTypeConfigInfo.KeepMostRecent).Selected = true;
            }
            if (ddlThreshold.Items.FindByValue(objLogTypeConfigInfo.NotificationThreshold.ToString()) != null)
            {
                ddlThreshold.ClearSelection();
                ddlThreshold.Items.FindByValue(objLogTypeConfigInfo.NotificationThreshold.ToString()).Selected = true;
            }
            if (ddlThresholdNotificationTime.Items.FindByValue(objLogTypeConfigInfo.NotificationThresholdTime.ToString()) != null)
            {
                ddlThresholdNotificationTime.ClearSelection();
                ddlThresholdNotificationTime.Items.FindByValue(objLogTypeConfigInfo.NotificationThresholdTime.ToString()).Selected = true;
            }
            if (ddlThresholdNotificationTimeType.Items.FindByText(objLogTypeConfigInfo.NotificationThresholdTimeType.ToString()) != null)
            {
                ddlThresholdNotificationTimeType.ClearSelection();
                ddlThresholdNotificationTimeType.Items.FindByText(objLogTypeConfigInfo.NotificationThresholdTimeType.ToString()).Selected = true;
            }
            txtMailFromAddress.Text = objLogTypeConfigInfo.MailFromAddress;
            txtMailToAddress.Text = objLogTypeConfigInfo.MailToAddress;
            DisableLoggingControls();
        }
开发者ID:biganth,项目名称:Curt,代码行数:48,代码来源:EditLogTypes.ascx.cs


示例7: UpgradeToVersion323

 private static void UpgradeToVersion323()
 {
     //add new SecurityException
     var logController = new LogController();
     string configFile = Globals.HostMapPath + "Logs\\LogConfig\\SecurityExceptionTemplate.xml.resources";
     logController.AddLogType(configFile, Null.NullString);
 }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:7,代码来源:Upgrade.cs


示例8: BindSummaryData

        private void BindSummaryData()
        {
            var objLogController = new LogController();
            ArrayList arrLogTypeConfigInfo = objLogController.GetLogTypeConfigInfo();

            dgLogTypeConfigInfo.DataSource = arrLogTypeConfigInfo;
            dgLogTypeConfigInfo.DataBind();
            pnlEditLogTypeConfigInfo.Visible = false;
            pnlLogTypeConfigInfo.Visible = true;
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:10,代码来源:EditLogTypes.ascx.cs


示例9: GetSelectedExceptions

        private XmlDocument GetSelectedExceptions()
        {
            XmlDocument objXML = new XmlDocument();
            try
            {
                
                string s = Request.Form["Exception"];
                if( s != null )
                {
                    string[] arrExcPositions = new string[0];
                    if( s.LastIndexOf( "," ) > 0 )
                    {
                        arrExcPositions = s.Split( Convert.ToChar( "," ) );
                    }
                    else if( s.Length > 0 )
                    {
                        arrExcPositions = new string[1];
                        arrExcPositions[0] = s;
                    }

                    LogController objLoggingController = new LogController();

                    objXML.LoadXml( "<LogEntries></LogEntries>" );

                    int i;
                    int j = arrExcPositions.Length;
                    for( i = 1; i <= arrExcPositions.Length; i++ )
                    {
                        j--;
                        string[] excKey;
                        excKey = arrExcPositions[j].Split( Convert.ToChar( "|" ) );
                        LogInfo objLogInfo = new LogInfo();
                        objLogInfo.LogGUID = excKey[0];
                        objLogInfo.LogFileID = excKey[1];
                        XmlNode objNode;
                        objNode = objXML.ImportNode( ( (XmlNode)objLoggingController.GetSingleLog( objLogInfo, LoggingProvider.ReturnType.XML ) ), true );
                        objXML.DocumentElement.AppendChild( objNode );
                    }
                }
            }
            catch( Exception exc )
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
            return objXML;
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:46,代码来源:LogViewer.ascx.cs


示例10: DgLogTypeConfigInfoEditCommand

        protected void DgLogTypeConfigInfoEditCommand(object source, GridCommandEventArgs e)
        {
            var logID = Convert.ToString(((GridDataItem)e.Item).GetDataKeyValue("ID"));
            ViewState["LogID"] = logID;

            BindDetailData();

            var l = new LogController();

            LogTypeConfigInfo objLogTypeConfigInfo = l.GetLogTypeConfigInfoByID(logID);

            chkIsActive.Checked = objLogTypeConfigInfo.LoggingIsActive;
            chkEmailNotificationStatus.Checked = objLogTypeConfigInfo.EmailNotificationIsActive;

            if (ddlLogTypeKey.Items.FindByValue(objLogTypeConfigInfo.LogTypeKey) != null)
            {
                ddlLogTypeKey.ClearSelection();
                ddlLogTypeKey.Items.FindByValue(objLogTypeConfigInfo.LogTypeKey).Selected = true;
            }
            if (ddlLogTypePortalID.Items.FindByValue(objLogTypeConfigInfo.LogTypePortalID) != null)
            {
                ddlLogTypePortalID.ClearSelection();
                ddlLogTypePortalID.Items.FindByValue(objLogTypeConfigInfo.LogTypePortalID).Selected = true;
            }
            if (ddlKeepMostRecent.Items.FindByValue(objLogTypeConfigInfo.KeepMostRecent) != null)
            {
                ddlKeepMostRecent.ClearSelection();
                ddlKeepMostRecent.Items.FindByValue(objLogTypeConfigInfo.KeepMostRecent).Selected = true;
            }
            if (ddlThreshold.Items.FindByValue(objLogTypeConfigInfo.NotificationThreshold.ToString(CultureInfo.InvariantCulture)) != null)
            {
                ddlThreshold.ClearSelection();
                ddlThreshold.Items.FindByValue(objLogTypeConfigInfo.NotificationThreshold.ToString(CultureInfo.InvariantCulture)).Selected = true;
            }
            if (ddlThresholdNotificationTime.Items.FindByValue(objLogTypeConfigInfo.NotificationThresholdTime.ToString(CultureInfo.InvariantCulture)) != null)
            {
                ddlThresholdNotificationTime.ClearSelection();
                ddlThresholdNotificationTime.Items.FindByValue(objLogTypeConfigInfo.NotificationThresholdTime.ToString(CultureInfo.InvariantCulture)).Selected = true;
            }
            if (ddlThresholdNotificationTimeType.Items.FindByText(objLogTypeConfigInfo.NotificationThresholdTimeType.ToString()) != null)
            {
                ddlThresholdNotificationTimeType.ClearSelection();
                ddlThresholdNotificationTimeType.Items.FindByText(objLogTypeConfigInfo.NotificationThresholdTimeType.ToString()).Selected = true;
            }
            txtMailFromAddress.Text = objLogTypeConfigInfo.MailFromAddress;
            txtMailToAddress.Text = objLogTypeConfigInfo.MailToAddress;
            DisableLoggingControls();

            e.Canceled = true; //disable inline editing in grid
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:50,代码来源:EditLogTypes.ascx.cs


示例11: OnUpdateClick

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// cmdUpdate_Click runs when the Update Button is clicked
        /// </summary>
        /// <remarks>
        /// </remarks>
        /// <history>
        /// 	[cnurse]	9/17/2004	Updated to reflect design changes for Help, 508 support
        ///                       and localisation
        /// </history>
        /// -----------------------------------------------------------------------------
        protected void OnUpdateClick(Object sender, EventArgs e)
        {
            var objLogTypeConfigInfo = new LogTypeConfigInfo
                                           {
                                               LoggingIsActive = chkIsActive.Checked,
                                               LogTypeKey = ddlLogTypeKey.SelectedItem.Value,
                                               LogTypePortalID = ddlLogTypePortalID.SelectedItem.Value,
                                               KeepMostRecent = ddlKeepMostRecent.SelectedItem.Value,

                                               EmailNotificationIsActive = chkEmailNotificationStatus.Checked,
                                               NotificationThreshold = Convert.ToInt32(ddlThreshold.SelectedItem.Value),
                                               NotificationThresholdTime = Convert.ToInt32(ddlThresholdNotificationTime.SelectedItem.Value),
                                               NotificationThresholdTimeType =
                                                   (LogTypeConfigInfo.NotificationThresholdTimeTypes)
                                                   Enum.Parse(typeof (LogTypeConfigInfo.NotificationThresholdTimeTypes), ddlThresholdNotificationTimeType.SelectedItem.Value),
                                               MailFromAddress = txtMailFromAddress.Text,
                                               MailToAddress = txtMailToAddress.Text
                                           };
            var l = new LogController();

            if (ViewState["LogID"] != null)
            {
                objLogTypeConfigInfo.ID = Convert.ToString(ViewState["LogID"]);
                l.UpdateLogTypeConfigInfo(objLogTypeConfigInfo);
                UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ConfigUpdated", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
            }
            else
            {
                objLogTypeConfigInfo.ID = Guid.NewGuid().ToString();
                l.AddLogTypeConfigInfo(objLogTypeConfigInfo);
                UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("ConfigAdded", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
            }
            BindSummaryData();
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:45,代码来源:EditLogTypes.ascx.cs


示例12: OnLoad

        /// -----------------------------------------------------------------------------
        /// <summary>
        /// The Page_Load runs when the page loads
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///   [cnurse] 17/9/2004  Updated for localization, Help and 508
        /// </history>
        /// -----------------------------------------------------------------------------
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            try
            {
                // If this is the first visit to the page, populate the site data
                if (Page.IsPostBack == false)
                {
                    var logController = new LogController();
                    logController.PurgeLogBuffer();
                    if (Request.QueryString["PageRecords"] != null)
                    {
                        ddlRecordsPerPage.SelectedValue = Request.QueryString["PageRecords"];
                    }
                    BindPortalDropDown();
                    BindLogTypeDropDown();
                    BindData();
                }
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:37,代码来源:LogViewer.ascx.cs


示例13: UpgradeToVersion711

        private static void UpgradeToVersion711()
        {
            DesktopModuleController.DeleteDesktopModule("FileManager");

            //Add TabUrl Logtypes
            var logController = new LogController();
            var logTypeInfo = new LogTypeInfo
            {
                LogTypeKey = EventLogController.EventLogType.TABURL_CREATED.ToString(),
                LogTypeFriendlyName = "TabURL created",
                LogTypeDescription = "",
                LogTypeCSSClass = "OperationSuccess",
                LogTypeOwner = "DotNetNuke.Logging.EventLogType"
            };
            logController.AddLogType(logTypeInfo);

            logTypeInfo.LogTypeKey = EventLogController.EventLogType.TABURL_UPDATED.ToString();
            logTypeInfo.LogTypeFriendlyName = "TabURL updated";
            logController.AddLogType(logTypeInfo);

            logTypeInfo.LogTypeKey = EventLogController.EventLogType.TABURL_DELETED.ToString();
            logTypeInfo.LogTypeFriendlyName = "TabURL deleted";
            logController.AddLogType(logTypeInfo);

        }
开发者ID:rut5949,项目名称:Dnn.Platform,代码行数:25,代码来源:Upgrade.cs


示例14: BindData

        private void BindData()
        {
            btnEmail.Attributes.Add( "onclick", "return CheckExceptions();" );

            if( ColorCodingOn )
            {
                chkColorCoding.Checked = true;
            }
            else
            {
                chkColorCoding.Checked = false;
            }

            if( ColorCodingLegendOn )
            {
                pnlLegend.Visible = true;
            }
            else
            {
                pnlLegend.Visible = false;
            }

            if( UserInfo.IsSuperUser )
            {
                btnClear.Visible = true;
                btnDelete.Visible = true;
                if( Page.IsPostBack && Request.QueryString["PortalID"] != null )
                {
                    ddlPortalid.Items.FindByValue( Request.QueryString["PortalID"] ).Selected = true;
                }
                intPortalID = int.Parse( ddlPortalid.SelectedItem.Value );
            }
            else
            {
                btnClear.Visible = false;
                btnDelete.Visible = false;
                intPortalID = PortalId;
            }

            int TotalRecords = 0;
            int PageSize = Convert.ToInt32( ddlRecordsPerPage.SelectedValue );

            if( Page.IsPostBack && Request.QueryString["LogTypeKey"] != null )
            {
                ddlLogType.Items.FindByValue( Request.QueryString["LogTypeKey"] ).Selected = true;
            }

            strLogTypeKey = ddlLogType.SelectedItem.Value;

            LogInfoArray objLog;
            int CurrentPage = PageIndex;
            if( CurrentPage > 0 )
            {
                CurrentPage--;
            }
            LogController objLogController = new LogController();
            if( intPortalID == - 1 && strLogTypeKey == "*" )
            {
                objLog = objLogController.GetLog( PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID == - 1 && strLogTypeKey != "*" )
            {
                objLog = objLogController.GetLog( strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID != - 1 && strLogTypeKey == "*" )
            {
                objLog = objLogController.GetLog( intPortalID, PageSize, CurrentPage, ref TotalRecords );
            }
            else if( intPortalID != - 1 && strLogTypeKey != "*" )
            {
                objLog = objLogController.GetLog( intPortalID, strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }
            else
            {
                objLog = objLogController.GetLog( strLogTypeKey, PageSize, CurrentPage, ref TotalRecords );
            }

            if( objLog.Count > 0 )
            {
                dlLog.Visible = true;
                pnlSendExceptions.Visible = true;
                if( UserInfo.IsSuperUser )
                {
                    btnDelete.Visible = true;
                    btnClear.Visible = true;
                }
                pnlOptions.Visible = true;
                tblInstructions.Visible = true;
                dlLog.DataSource = objLog;
                dlLog.DataBind();

                InitializePaging( ctlPagingControlBottom, TotalRecords, PageSize );
            }
            else
            {
                UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "NoEntries", this.LocalResourceFile ), ModuleMessageType.YellowWarning );
                dlLog.Visible = false;
                pnlSendExceptions.Visible = false;
                btnDelete.Visible = false;
                btnClear.Visible = false;
//.........这里部分代码省略.........
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:101,代码来源:LogViewer.ascx.cs


示例15: OnInit

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            jQuery.RequestDnnPluginsRegistration();

            btnClear.Click += BtnClearClick;
            btnDelete.Click += BtnDeleteClick;
            btnEmail.Click += BtnEmailClick;
            ddlLogType.SelectedIndexChanged += DdlLogTypeSelectedIndexChanged;
            ddlPortalid.SelectedIndexChanged += DdlPortalIDSelectedIndexChanged;
            ddlRecordsPerPage.SelectedIndexChanged += DdlRecordsPerPageSelectedIndexChanged;

            if (Request.QueryString["CurrentPage"] != null)
            {
                _pageIndex = Convert.ToInt32(Request.QueryString["CurrentPage"]);
            }

            var logController = new LogController();
            _logTypeDictionary = logController.GetLogTypeInfoDictionary();
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:21,代码来源:LogViewer.ascx.cs


示例16: Page_Init

        protected void Page_Init( Object sender, EventArgs e )
        {
            
            LogController l = new LogController();
            arrLogTypeInfo = l.GetLogTypeInfo();

            htLogTypeInfo = new Hashtable();

            int i;
            for( i = 0; i <= arrLogTypeInfo.Count - 1; i++ )
            {
                LogTypeInfo objLogTypeInfo = (LogTypeInfo)arrLogTypeInfo[i];
                htLogTypeInfo.Add( objLogTypeInfo.LogTypeKey, objLogTypeInfo );
            }

            string ColorCoding;
            ColorCoding = Convert.ToString( Personalization.GetProfile( "LogViewer", "ColorCoding" ) );
            if( ColorCoding == "0" )
            {
                ColorCodingOn = false;
            }
            else if( ColorCoding == "1" )
            {
                ColorCodingOn = true;
            }
            else
            {
                ColorCodingOn = true;
            }

            string ColorCodingLegend;
            ColorCodingLegend = Convert.ToString( Personalization.GetProfile( "LogViewer", "ColorCodingLegend" ) );
            if( ColorCodingLegend == "0" )
            {
                ColorCodingLegendOn = false;
            }
            else if( ColorCodingLegend == "1" )
            {
                ColorCodingLegendOn = true;
            }
            else
            {
                ColorCodingLegendOn = true;
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:45,代码来源:LogViewer.ascx.cs


示例17: btnClear_Click

 protected void btnClear_Click( Object sender, EventArgs e )
 {
     LogController objLoggingController = new LogController();
     objLoggingController.ClearLog();
     UI.Skins.Skin.AddModuleMessage( this, Localization.GetString( "LogCleared", this.LocalResourceFile ), ModuleMessageType.GreenSuccess );
     BindPortalDropDown();
     dlLog.Visible = false;
     pnlSendExceptions.Visible = false;
     btnDelete.Visible = false;
     btnClear.Visible = false;
     pnlOptions.Visible = false;
     pnlLegend.Visible = false;
     tblInstructions.Visible = false;
 }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:14,代码来源:LogViewer.ascx.cs


示例18: Page_Load

        /// <summary>
        /// The Page_Load runs when the page loads
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <remarks>
        /// </remarks>
        /// <history>
        ///   [cnurse] 17/9/2004  Updated for localization, Help and 508
        /// </history>
        protected void Page_Load( Object sender, EventArgs e )
        {
            try
            {
                

                // If this is the first visit to the page, populate the site data
                if( Page.IsPostBack == false )
                {
                    LogController objLC = new LogController();
                    objLC.PurgeLogBuffer();

                    if( Request.QueryString["CurrentPage"] != null )
                    {
                        PageIndex = Convert.ToInt32( Request.QueryString["CurrentPage"] );
                    }
                    else
                    {
                        PageIndex = 1;
                    }

                    if( Request.QueryString["PageRecords"] != null )
                    {
                        ddlRecordsPerPage.SelectedValue = Request.QueryString["PageRecords"];
                    }

                    BindPortalDropDown();
                    BindLogTypeDropDown();
                    BindData();
                }
            }
            catch( Exception exc ) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException( this, exc );
            }
        }
开发者ID:huayang912,项目名称:cs-dotnetnuke,代码行数:46,代码来源:LogViewer.ascx.cs


示例19: UpgradeToVersion501

 private static void UpgradeToVersion501()
 {
     //add new Cache Error Event Type
     var logController = new LogController();
     string configFile = string.Format("{0}Logs\\LogConfig\\CacheErrorTemplate.xml.resources", Globals.HostMapPath);
     logController.AddLogType(configFile, Null.NullString);
 }
开发者ID:ryanmalone,项目名称:BGDNNWEB,代码行数:7,代码来源:Upgrade.cs


示例20: BtnClearClick

        private void BtnClearClick(Object sender, EventArgs e)
        {
            var objLoggingController = new LogController();
            objLoggingController.ClearLog();
            UI.Skins.Skin.AddModuleMessage(this, Localization.GetString("LogCleared", LocalResourceFile), ModuleMessage.ModuleMessageType.GreenSuccess);
            var objEventLog = new EventLogController();

            //add entry to log recording it was cleared
            objEventLog.AddLog(Localization.GetString("LogCleared", LocalResourceFile),
                               Localization.GetString("Username", LocalResourceFile) + ":" + UserInfo.Username,
                               PortalSettings,
                               -1,
                               EventLogController.EventLogType.ADMIN_ALERT);
            BindPortalDropDown();
            dlLog.Visible = false;
            btnDelete.Visible = false;
            btnClear.Visible = false;
            ctlPagingControlBottom.Visible = false;
        }
开发者ID:rcedev,项目名称:evans-software-solutions,代码行数:19,代码来源:LogViewer.ascx.cs



注:本文中的DotNetNuke.Services.Log.EventLog.LogController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# EventLog.LogInfo类代码示例发布时间:2022-05-24
下一篇:
C# EventLog.EventLogController类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap