public virtual void UpdateLogType(LogTypeInfo logType) { LoggingProvider.Instance().UpdateLogType(logType.LogTypeKey, logType.LogTypeFriendlyName, logType.LogTypeDescription, logType.LogTypeCSSClass, logType.LogTypeOwner); }
public virtual object GetSingleLog(LogInfo log, LoggingProvider.ReturnType returnType) { return(LoggingProvider.Instance().GetSingleLog(log, returnType)); }
public void PurgeLogBuffer() { LoggingProvider.Instance().PurgeLogBuffer(); }
public virtual LogTypeConfigInfo GetLogTypeConfigInfoByID(string id) { return(LoggingProvider.Instance().GetLogTypeConfigInfoByID(id)); }
public virtual Dictionary <string, LogTypeInfo> GetLogTypeInfoDictionary() { return(LoggingProvider.Instance().GetLogTypeInfo().Cast <LogTypeInfo>().ToDictionary(logTypeInfo => logTypeInfo.LogTypeKey)); }
public virtual List <LogInfo> GetLogs(int portalID, string logType, int pageSize, int pageIndex, ref int totalRecords) { return(LoggingProvider.Instance().GetLogs(portalID, logType, pageSize, pageIndex, ref totalRecords)); }
public virtual ArrayList GetLogTypeConfigInfo() { return(LoggingProvider.Instance().GetLogTypeConfigInfo()); }
public virtual void DeleteLogTypeConfigInfo(LogTypeConfigInfo logTypeConfig) { LoggingProvider.Instance().DeleteLogTypeConfigInfo(logTypeConfig.ID); }
public virtual void DeleteLogType(LogTypeInfo logType) { LoggingProvider.Instance().DeleteLogType(logType.LogTypeKey); }
public void DeleteLog(LogInfo logInfo) { LoggingProvider.Instance().DeleteLog(logInfo); }
public void ClearLog() { LoggingProvider.Instance().ClearLog(); }
public void AddLog(LogInfo logInfo) { //if (Globals.Status == Globals.UpgradeStatus.Install) //{ // Logger.Info(logInfo); //} //else //{ try { logInfo.LogCreateDate = DateTime.Now; logInfo.LogServerName = Globals.ServerName; if (string.IsNullOrEmpty(logInfo.LogServerName)) { logInfo.LogServerName = "NA"; } if (String.IsNullOrEmpty(logInfo.LogUserName)) { logInfo.LogUserName = ""; //if (HttpContext.Current != null) //{ // if (HttpContext.Current.Request.IsAuthenticated) // { // logInfo.LogUserName = UserController.Instance.GetCurrentUserInfo().Username; // } //} } //Get portal name if name isn't set if (logInfo.LogPortalID != Null.NullInteger && String.IsNullOrEmpty(logInfo.LogPortalName)) { //logInfo.LogPortalName = PortalController.Instance.GetPortal(logInfo.LogPortalID).PortalName; logInfo.LogPortalName = ""; } //Check if Log Type exists if (!GetLogTypeInfoDictionary().ContainsKey(logInfo.LogTypeKey)) { //Add new Log Type var logType = new LogTypeInfo() { LogTypeKey = logInfo.LogTypeKey, LogTypeFriendlyName = logInfo.LogTypeKey, LogTypeOwner = "DotNetNuke.Logging.EventLogType", LogTypeCSSClass = "GeneralAdminOperation", LogTypeDescription = string.Empty }; AddLogType(logType); var logTypeConfigInfo = new LogTypeConfigInfo() { LogTypeKey = logInfo.LogTypeKey, LogTypePortalID = "*", LoggingIsActive = false, KeepMostRecent = "-1", EmailNotificationIsActive = false, NotificationThreshold = 1, NotificationThresholdTime = 1, NotificationThresholdTimeType = LogTypeConfigInfo.NotificationThresholdTimeTypes.Seconds, MailFromAddress = String.Empty, MailToAddress = String.Empty }; AddLogTypeConfigInfo(logTypeConfigInfo); } if (LoggingProvider.Instance() != null) { try { LoggingProvider.Instance().AddLog(logInfo); } catch (Exception) { if (Globals.Status != Globals.UpgradeStatus.Upgrade) //this may caught exception during upgrade because old logging provider has problem in it. { throw; } } } } catch (Exception exc) { Logger.Error(exc); AddLogToFile(logInfo); } //} }