Exemplo n.º 1
0
        private void LogInterestingPropertyValues(COWContactLogging.ContactChangeLogEvent loggingEvent, COWTriggerAction operation, CoreItem item, IEnumerable <StorePropertyDefinition> allUniqueInterestingProperties)
        {
            StringBuilder stringBuilder = new StringBuilder(200);

            foreach (StorePropertyDefinition storePropertyDefinition in allUniqueInterestingProperties)
            {
                stringBuilder.Clear();
                object obj = this.GetPropertyValueForLogging(item, storePropertyDefinition);
                obj = this.SanitizePropertyValueForLogging(obj);
                stringBuilder.Append("[New=");
                stringBuilder.Append(obj);
                bool flag = item.PropertyBag.IsPropertyDirty(storePropertyDefinition);
                if (flag && operation != COWTriggerAction.Create)
                {
                    object obj2 = this.GetOriginalPropertyValueForLogging(item, storePropertyDefinition);
                    obj2 = this.SanitizePropertyValueForLogging(obj2);
                    if (obj2 != obj)
                    {
                        stringBuilder.Append(",Old=");
                        stringBuilder.Append(obj2);
                    }
                }
                stringBuilder.Append("]");
                string key = SpecialCharacters.SanitizeForLogging(storePropertyDefinition.Name);
                loggingEvent.Add(key, stringBuilder.ToString());
            }
        }
        private string GetExceptionInfo(Exception ex)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(ex.GetType().Name + " ExceptionMessage " + SpecialCharacters.SanitizeForLogging(ex.Message));
            string stackTrace = ex.StackTrace;

            if (!string.IsNullOrEmpty(stackTrace))
            {
                stringBuilder.Append(" StackTrace - ");
                stringBuilder.Append(SpecialCharacters.SanitizeForLogging(stackTrace));
            }
            return(stringBuilder.ToString());
        }
        // Token: 0x06000871 RID: 2161 RVA: 0x0003AFDC File Offset: 0x000391DC
        private void AddExtendedProperty(string extendedTypeLabel, string folderType, string folderId, bool isSuccess)
        {
            string key;

            if (folderId != null)
            {
                key = string.Format("{0}.{1}[{2}]", extendedTypeLabel, folderType, SpecialCharacters.SanitizeForLogging(folderId));
            }
            else
            {
                key       = string.Format("{0}.{1}[{2}]", extendedTypeLabel, "UnknownFolderId", SpecialCharacters.SanitizeForLogging(Guid.NewGuid().ToString()));
                isSuccess = false;
            }
            if (!this.extendedPropertiesMap.ContainsKey(key))
            {
                this.extendedPropertiesMap.Add(key, isSuccess.ToString());
            }
        }
        // Token: 0x0600009D RID: 157 RVA: 0x00004CB4 File Offset: 0x00002EB4
        protected string FormatExceptionListToString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            foreach (AssistantLogEntryBase.ExceptionInfo exceptionInfo in this.exceptions)
            {
                stringBuilder.Append(string.Format("{0}_{1}_{2}_{3}_{4}_{5}|", new object[]
                {
                    exceptionInfo.Name,
                    exceptionInfo.InnerException,
                    exceptionInfo.Count,
                    SpecialCharacters.SanitizeForLogging(exceptionInfo.Message),
                    SpecialCharacters.SanitizeForLogging(exceptionInfo.StackTrace),
                    exceptionInfo.DiagnosticContext
                }));
            }
            return(stringBuilder.ToString().TrimEnd(new char[]
            {
                '|'
            }));
        }
Exemplo n.º 5
0
 // Token: 0x060008AA RID: 2218 RVA: 0x0003B5C4 File Offset: 0x000397C4
 private void AddToStackTraceList(Exception ex, string key)
 {
     if (!this.Exceptions.ContainsKey(key))
     {
         if (this.SanitizedStackTraces == null)
         {
             this.SanitizedStackTraces = new List <List <KeyValuePair <string, object> > >();
         }
         List <KeyValuePair <string, object> > list = new List <KeyValuePair <string, object> >();
         list.Add(new KeyValuePair <string, object>("MGUID", string.Format("{0}", this.MailboxGuid)));
         list.Add(new KeyValuePair <string, object>("FID", string.Format("{0}", this.FolderId)));
         list.Add(new KeyValuePair <string, object>("EX", string.Format("{0}", key)));
         list.Add(new KeyValuePair <string, object>("MSG", string.Format("{0}", SpecialCharacters.SanitizeForLogging(ex.Message))));
         list.Add(new KeyValuePair <string, object>("EXTRACE", string.Format("{0}", SpecialCharacters.SanitizeForLogging(ex.StackTrace))));
         this.SanitizedStackTraces.Add(list);
     }
 }