Exemple #1
0
        internal static void HandleStartExecption(string startName, Type errorType, Exception ex)
        {
            string type = errorType != null?errorType.ToString() : string.Empty;

            ExceptionData exData = new ExceptionData(null, type, null, ex);

            TkDebug.ThrowIfNoAppSetting();
            if (!BaseAppSetting.Current.UseWorkThread)
            {
                return;
            }

            TkDebug.ThrowIfNoGlobalVariable();
            string   fileName = WebAppSetting.WebCurrent.GetStartLogName(startName, exData.Exception);
            string   content  = exData.WriteXml();
            Encoding encoding = WriteSettings.Default.Encoding;

            SaveFile(fileName, content, encoding);
            //BaseGlobalVariable.Current.BeginInvoke(new Action<string, string, Encoding>(SaveFile),
            //    fileName, content, encoding);
        }
Exemple #2
0
        public static string LogException(ExceptionData logData)
        {
            if (logData == null)
            {
                return(null);
            }

            TkDebug.ThrowIfNoAppSetting();
            if (!BaseAppSetting.Current.UseWorkThread)
            {
                return(null);
            }

            TkDebug.ThrowIfNoGlobalVariable();
            string   fileName = WebAppSetting.WebCurrent.GetExceptionLogName(logData.Exception);
            string   content  = logData.WriteXml();
            Encoding encoding = BaseAppSetting.Current.WriteSettings.Encoding;

            BaseGlobalVariable.Current.BeginInvoke(new Action <string, string, Encoding>(SaveFile),
                                                   fileName, content, encoding);

            return(fileName);
        }