Exemplo n.º 1
0
 public void LogDiscoverySearchStatusChangedEvent(MailboxDiscoverySearch obj, string parentCallerInfo, [CallerMemberName] string callerMember = null)
 {
     SearchEventLogger.PropertyLogData propertyLogData = new SearchEventLogger.PropertyLogData();
     propertyLogData.AddProperty("CallerInfo", parentCallerInfo + ": " + callerMember);
     propertyLogData.AddProperty(EwsStoreObjectSchema.Identity.Name, obj.Identity);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Status.Name, obj.Status);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.StatisticsOnly.Name, obj.StatisticsOnly);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.IncludeUnsearchableItems.Name, obj.IncludeUnsearchableItems);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.IncludeKeywordStatistics.Name, obj.IncludeKeywordStatistics);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Query.Name, (obj.Query != null) ? obj.Query.Length : 0);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Language.Name, obj.Language);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Sources.Name, obj.Sources);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.CreatedTime.Name, obj.CreatedTime);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.LastModifiedTime.Name, obj.LastModifiedTime);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ExcludeDuplicateMessages.Name, obj.ExcludeDuplicateMessages);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.InPlaceHoldEnabled.Name, obj.InPlaceHoldEnabled);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ItemHoldPeriod.Name, obj.ItemHoldPeriod);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.InPlaceHoldIdentity.Name, obj.InPlaceHoldIdentity);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.FailedToHoldMailboxes.Name, obj.FailedToHoldMailboxes);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.KeywordHits.Name, (obj.KeywordHits != null) ? obj.KeywordHits.Count : 0);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ScenarioId.Name, obj.ScenarioId);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Resume.Name, obj.Resume);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.LastStartTime.Name, obj.LastStartTime);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.LastEndTime.Name, obj.LastEndTime);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.PercentComplete.Name, obj.PercentComplete);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.NumberOfMailboxes.Name, obj.NumberOfMailboxes);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultItemCountCopied.Name, obj.ResultItemCountCopied);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultItemCountEstimate.Name, obj.ResultItemCountEstimate);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultSizeCopied.Name, obj.ResultSizeCopied);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultSizeEstimate.Name, obj.ResultSizeEstimate);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultsPath.Name, obj.ResultsPath);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.ResultsLink.Name, obj.ResultsLink);
     propertyLogData.AddProperty(MailboxDiscoverySearchSchema.CompletedMailboxes.Name, obj.CompletedMailboxes);
     propertyLogData.AddOrganization(obj.ManagedByOrganization);
     if (obj.Errors != null && obj.Errors.Count > 0)
     {
         propertyLogData.AddProperty(MailboxDiscoverySearchSchema.Errors.Name, string.Join(",", obj.Errors.ToArray()));
     }
     if (obj.IsFeatureFlighted("SearchStatsFlighted") && obj.SearchStatistics != null && obj.SearchStatistics.Count > 0 && obj.SearchStatistics[0] != null)
     {
         propertyLogData.AddProperty(MailboxDiscoverySearchSchema.SearchStatistics.Name, obj.SearchStatistics[0].ToString());
     }
     propertyLogData.AddProperty("Flighted Features", obj.FlightedFeatures);
     this.logger.LogEvent(StorageEventLogConstants.Tuple_DiscoverySearchStatusChanged, null, new object[]
     {
         propertyLogData
     });
 }
Exemplo n.º 2
0
        private static void BuildResultNumbers(StringBuilder sbLogMailBody, MailboxDiscoverySearch searchObject, KeywordHit unsearchableHit)
        {
            if (searchObject.IsFeatureFlighted("SearchStatsFlighted"))
            {
                Util.BuildResultNumbersEx(sbLogMailBody, searchObject);
                return;
            }
            Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.ResultNumberEstimate, searchObject.ResultItemCountEstimate);
            if (searchObject.ExcludeDuplicateMessages)
            {
                Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.EstimateNotExcludeDuplicates, Strings.LogFieldsEstimateNotExcludeDuplicates);
            }
            else
            {
                Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.EstimateNotExcludeDuplicates, string.Empty);
            }
            string value = searchObject.ResultItemCountCopied.ToString();

            if (unsearchableHit != null)
            {
                value = string.Format(Strings.MailboxSeachCountIncludeUnsearchable, searchObject.ResultItemCountCopied, unsearchableHit.Count);
            }
            Util.ReplaceLogFieldTags(sbLogMailBody, Globals.LogFields.ResultNumber, value);
        }