示例#1
0
        public static string[] GetCacheKeys()
        {
            string[] CacheKeys = new string[] { };
            try
            {
                string cacheKey = "OpenUrlRewriterCacheKeys";
                CacheKeys = (string[])DataCache.GetCache(cacheKey);
                if (CacheKeys == null)
                {
                    var builder = new UrlBuilder();
                    CacheKeys = builder.BuildCacheKeys();
                    DataCache.SetCache(cacheKey, CacheKeys);
                }
            }
            catch (Exception ex)
            {
                //log it
                var objEventLog = new EventLogController();

                var objEventLogInfo = new LogInfo()
                {
                    LogTypeKey = "GENERAL_EXCEPTION"
                };
                objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetCacheKeys Failed");
                objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);

                objEventLogInfo.AddProperty("Exception Type", ex.GetType().ToString());
                objEventLogInfo.AddProperty("Message", ex.Message);
                objEventLogInfo.AddProperty("Stack Trace", ex.StackTrace);
                if (ex.InnerException != null)
                {
                    objEventLogInfo.AddProperty("Inner Exception Message", ex.InnerException.Message);
                    objEventLogInfo.AddProperty("Inner Exception Stacktrace", ex.InnerException.StackTrace);
                }
                objEventLogInfo.BypassBuffering = true;

                objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
                objEventLog.AddLog(objEventLogInfo);
                Logger.Error(ex);
            }
            return(CacheKeys);
        }
示例#2
0
 public static string[] GetCacheKeys(int PortalId)
 {
     string[] CacheKeys = new string[] { };
     try
     {
         var builder = new UrlBuilder();
         CacheKeys = builder.BuildCacheKeys(PortalId);
     }
     catch (Exception ex)
     {
         //log it
         var objEventLog     = new EventLogController();
         var objEventLogInfo = new LogInfo();
         objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetCacheKeys Failed");
         objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);
         objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
         objEventLog.AddLog(objEventLogInfo);
         Logger.Error(ex);
     }
     return(CacheKeys);
 }
        public static string[] GetCacheKeys(int PortalId)
        {
            string[] CacheKeys = new string[] { };
            try
            {

                var builder = new UrlBuilder();
                CacheKeys = builder.BuildCacheKeys(PortalId);

            }
            catch (Exception ex)
            {
                //log it
                var objEventLog = new EventLogController();
                var objEventLogInfo = new LogInfo();
                objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetCacheKeys Failed");
                objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);
                objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
                objEventLog.AddLog(objEventLogInfo);
                Logger.Error(ex);

            }
            return CacheKeys;
        }
        public static string[] GetCacheKeys()
        {
            string[] CacheKeys = new string[] { };
            try
            {
                string cacheKey = "OpenUrlRewriterCacheKeys";
                CacheKeys = (string[])DataCache.GetCache(cacheKey);
                if (CacheKeys == null)
                {
                    var builder = new UrlBuilder();
                    CacheKeys = builder.BuildCacheKeys();
                    DataCache.SetCache(cacheKey, CacheKeys);
                }
            }
            catch (Exception ex)
            {
                //log it
                var objEventLog = new EventLogController();

                var objEventLogInfo = new LogInfo() { LogTypeKey = "GENERAL_EXCEPTION" };
                objEventLogInfo.AddProperty("UrlRewriter.RewriterConfiguration", "GetCacheKeys Failed");
                objEventLogInfo.AddProperty("ExceptionMessage", ex.Message);

                objEventLogInfo.AddProperty("Exception Type", ex.GetType().ToString());
                objEventLogInfo.AddProperty("Message", ex.Message);
                objEventLogInfo.AddProperty("Stack Trace", ex.StackTrace);
                if (ex.InnerException != null)
                {
                    objEventLogInfo.AddProperty("Inner Exception Message", ex.InnerException.Message);
                    objEventLogInfo.AddProperty("Inner Exception Stacktrace", ex.InnerException.StackTrace);
                }
                objEventLogInfo.BypassBuffering = true;

                objEventLogInfo.LogTypeKey = EventLogController.EventLogType.HOST_ALERT.ToString();
                objEventLog.AddLog(objEventLogInfo);
                Logger.Error(ex);

            }
            return CacheKeys;
        }