コード例 #1
0
ファイル: Globals.cs プロジェクト: YHZX2013/exchange_diff
        internal static bool LogEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
        {
            bool result;

            try
            {
                object[] array = new object[messageArgs.Length + 2];
                if (InstanceType.Multiple == Globals.ProcessInstanceType)
                {
                    array[0] = Globals.processNameAppName;
                }
                else
                {
                    array[0] = Globals.processName;
                }
                array[1] = Globals.processId;
                messageArgs.CopyTo(array, 2);
                result = Globals.logger.LogEvent(tuple, periodicKey, array);
            }
            catch (Win32Exception ex)
            {
                if (ex.ErrorCode == 5)
                {
                    throw new SecurityException(DirectoryStrings.AccessDeniedToEventLog, ex);
                }
                throw;
            }
            return(result);
        }
コード例 #2
0
 // Token: 0x0600014F RID: 335 RVA: 0x00008B30 File Offset: 0x00006D30
 private void LogDiscoveryQueryLoadFailure(IExchangePrincipal mailboxOwner, ExEventLog.EventTuple message)
 {
     Globals.Logger.LogEvent(message, null, new object[]
     {
         mailboxOwner
     });
 }
コード例 #3
0
 public void LogEvent(ExEventLog.EventTuple eventTuple, Exception exception)
 {
     StoreDriverDeliveryDiagnostics.LogEvent(eventTuple, exception.Message, new object[]
     {
         exception
     });
 }
コード例 #4
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
 public void LogEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
 {
     if (this.eventLog != null)
     {
         this.eventLog.LogEvent(tuple, periodicKey, messageArgs);
     }
 }
コード例 #5
0
 // Token: 0x06000A70 RID: 2672 RVA: 0x00028C3E File Offset: 0x00026E3E
 internal static void LogToDatacenterOnly(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
 {
     if (Globals.IsDatacenter)
     {
         ExtensionDiagnostics.Logger.LogEvent(tuple, periodicKey, messageArgs);
     }
 }
コード例 #6
0
 public void FailedDbSeed(ExEventLog.EventTuple errorEventTuple, LocalizedString errorMessage, ExtendedErrorInfo errorInfo)
 {
     lock (this.m_instance)
     {
         this.LogCrimsonEventOnStateChange <bool>("Seeding", this.Seeding, false);
         this.Seeding = false;
         if (this.m_perfmonCounters != null)
         {
             this.m_perfmonCounters.Failed       = 1L;
             this.m_perfmonCounters.Disconnected = 0L;
             if (this.Suspended)
             {
                 this.m_perfmonCounters.FailedSuspended = 1L;
             }
         }
         if (this.Suspended)
         {
             this.SetSuspendedInternal();
         }
         this.FailureInfo.SetBroken(errorEventTuple, errorMessage, errorInfo);
         this.FailureInfo.PersistFailure(this.m_replayState);
         ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string, LocalizedString>((long)this.GetHashCode(), "{0}: Seeding failed with error: {1}", this.m_displayName, errorMessage);
         this.ExternalStatus.Refresh();
     }
 }
コード例 #7
0
        private void SetDisconnectedInternal(FailureTag failureTag, ExEventLog.EventTuple setDisconnectedEventTuple, params string[] setDisconnectedArgs)
        {
            string[] argumentsWithDb = ReplicaInstanceContext.GetArgumentsWithDb(setDisconnectedArgs, this.m_displayName);
            int      num;
            string   text = setDisconnectedEventTuple.EventLogToString(out num, argumentsWithDb);

            lock (this.m_instance)
            {
                if (!this.FailureInfo.IsFailed)
                {
                    this.LogCrimsonEventOnStateChange <bool>("Disconnected", this.FailureInfo.IsDisconnected, true);
                    this.FailureInfo.SetDisconnected(setDisconnectedEventTuple, new LocalizedString(text));
                    if (this.m_perfmonCounters != null)
                    {
                        this.m_perfmonCounters.Disconnected = 1L;
                    }
                }
                else
                {
                    ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string>((long)this.GetHashCode(), "{0} SetDisconnected ignored because RI is already marked Failed.", this.m_displayName);
                }
                this.ExternalStatus.Refresh();
            }
            bool flag2;

            setDisconnectedEventTuple.LogEvent(this.m_identity, out flag2, argumentsWithDb);
            ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string, string>((long)this.GetHashCode(), "{0} SetDisconnected because {1}", this.m_displayName, text);
        }
コード例 #8
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
 public EventData(ExEventLog.EventTuple tuple, string component, string tag, string exception)
 {
     this.Tuple     = tuple;
     this.Component = component;
     this.Tag       = tag;
     this.Exception = exception;
 }
コード例 #9
0
        private void LogAdminSyncOperationFailure(string operationName, int transientFailure, int permanentFailure, string details)
        {
            string text = string.Format(CultureInfo.InvariantCulture, "AdminSync operation <{0}> failed with <{1}> transient failure(s) and <{2}> permanent failure(s). Details: {3}", new object[]
            {
                operationName,
                transientFailure,
                permanentFailure,
                details
            });
            Exception exception = new EhfAdminAccountSynchronizer.EhfAdminSyncTransientResponseException(text);

            if (transientFailure > 0 && this.errorTracker.AllTransientFailuresCount == 1)
            {
                ExEventLog.EventTuple tuple_EhfAdminSyncTransientFailure = EdgeSyncEventLogConstants.Tuple_EhfAdminSyncTransientFailure;
                base.EventLogAndTraceException(operationName, tuple_EhfAdminSyncTransientFailure, exception, details);
                return;
            }
            if (permanentFailure > 0)
            {
                ExEventLog.EventTuple tuple_EhfAdminSyncPermanentFailure = EdgeSyncEventLogConstants.Tuple_EhfAdminSyncPermanentFailure;
                base.EventLogAndTraceException(operationName, tuple_EhfAdminSyncPermanentFailure, exception, details);
                return;
            }
            base.DiagSession.LogAndTraceError(text, new object[0]);
        }
コード例 #10
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
		public void LogEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
		{
			object[] array = new object[messageArgs.Length + 1];
			array[0] = this.serviceName;
			Array.Copy(messageArgs, 0, array, 1, messageArgs.Length);
			this.logger.LogEvent(tuple, periodicKey, array);
		}
コード例 #11
0
 protected override void OnRequestException(HttpWebRequest request, WebException exception)
 {
     ExTraceGlobals.ProxyTracer.TraceError <Uri, WebException>(0, 0L, "Request Exception. Url={0}, Exception={1}", request.RequestUri, exception);
     base.OnRequestException(request, exception);
     if (!exception.IsProxyNeedIdentityError())
     {
         string machineName = Environment.MachineName;
         string host        = request.RequestUri.Host;
         ExEventLog.EventTuple proxyEventLogTuple = exception.GetProxyEventLogTuple();
         if (proxyEventLogTuple.Period == ExEventLog.EventPeriod.LogAlways)
         {
             proxyEventLogTuple.LogEvent(new object[]
             {
                 EcpEventLogExtensions.GetUserNameToLog(),
                 machineName,
                 host,
                 request.RequestUri,
                 exception
             });
             return;
         }
         proxyEventLogTuple.LogPeriodicEvent(host, new object[]
         {
             EcpEventLogExtensions.GetUserNameToLog(),
             machineName,
             host
         });
     }
 }
コード例 #12
0
 // Token: 0x060023BE RID: 9150 RVA: 0x000A7870 File Offset: 0x000A5A70
 public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, Exception exception, params string[] setBrokenArgs)
 {
     lock (this)
     {
         this.SetBrokenInterface.SetBroken(failureTag, setBrokenEventTuple, exception, setBrokenArgs);
     }
 }
コード例 #13
0
 // Token: 0x06000151 RID: 337 RVA: 0x00008B84 File Offset: 0x00006D84
 private void LogDiscoveryQueryLoadFailure(string orgId, ExEventLog.EventTuple message, Exception ex)
 {
     Globals.Logger.LogEvent(message, null, new object[]
     {
         orgId,
         (ex == null) ? string.Empty : ex.ToString()
     });
 }
コード例 #14
0
 // Token: 0x06001018 RID: 4120 RVA: 0x00041DCC File Offset: 0x0003FFCC
 internal void LogEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
 {
     base.CheckDisposed();
     object[] array = new object[messageArgs.Length + 1];
     array[0] = this.serviceName;
     Array.Copy(messageArgs, 0, array, 1, messageArgs.Length);
     ServerPickerManager.EventLog.LogEvent(tuple, periodicKey, array);
 }
コード例 #15
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
 protected virtual bool InternalTrigger(string triggerName, params object[] args)
 {
     EventLogger.EventData      eventData   = this.tuples[triggerName];
     ExEventLog.EventTuple      tuple       = eventData.Tuple;
     TriggerHandler.TriggerData triggerData = TriggerHandler.Triggers[triggerName];
     Log.LogMessage(triggerData.Type, triggerData.Format, args);
     return(this.LogEvent(tuple, args));
 }
コード例 #16
0
ファイル: Globals.cs プロジェクト: YHZX2013/exchange_diff
 internal static bool LogExchangeTopologyEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
 {
     object[] array = new object[messageArgs.Length + 2];
     array[0] = Globals.ProcessName;
     array[1] = Globals.ProcessId;
     messageArgs.CopyTo(array, 2);
     return(Globals.exchangeTopologyLogger.LogEvent(tuple, periodicKey, array));
 }
コード例 #17
0
 // Token: 0x06000152 RID: 338 RVA: 0x00008BC0 File Offset: 0x00006DC0
 private void LogDiscoveryQueryLoadFailure(IExchangePrincipal mailboxOwner, ExEventLog.EventTuple message, Exception ex)
 {
     Globals.Logger.LogEvent(message, null, new object[]
     {
         mailboxOwner,
         (ex == null) ? string.Empty : ex.ToString()
     });
 }
コード例 #18
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
 private void InitializeTuples()
 {
     string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
     foreach (string text in manifestResourceNames)
     {
         if (text.EndsWith("EventLog.xml"))
         {
             SafeXmlDocument safeXmlDocument = new SafeXmlDocument();
             safeXmlDocument.Load(Assembly.GetExecutingAssembly().GetManifestResourceStream(text));
             Dictionary <string, short> dictionary = new Dictionary <string, short>();
             foreach (object obj in safeXmlDocument.SelectNodes("/root/category"))
             {
                 XmlElement xmlElement = (XmlElement)obj;
                 string     attribute  = xmlElement.GetAttribute("name");
                 short      value      = short.Parse(xmlElement.SelectSingleNode("number").InnerText);
                 dictionary.Add(attribute, value);
             }
             foreach (object obj2 in safeXmlDocument.SelectNodes("/root/data"))
             {
                 XmlElement xmlElement2 = (XmlElement)obj2;
                 string     attribute2  = xmlElement2.GetAttribute("name");
                 uint       eventId     = (uint)Enum.Parse(typeof(MSExchangeDiagnosticsEventLogConstants.Message), attribute2);
                 string     innerText   = xmlElement2.SelectSingleNode("category").InnerText;
                 string     innerText2  = xmlElement2.SelectSingleNode("stringvalue").InnerText;
                 short      categoryId  = dictionary[innerText];
                 string     innerText3  = xmlElement2.SelectSingleNode("eventtype").InnerText;
                 string     component   = string.Empty;
                 XmlNode    xmlNode     = xmlElement2.SelectSingleNode("component");
                 if (xmlNode != null)
                 {
                     component = EventLogger.FormatString(xmlNode.InnerText);
                 }
                 string  tag      = string.Empty;
                 XmlNode xmlNode2 = xmlElement2.SelectSingleNode("tag");
                 if (xmlNode2 != null)
                 {
                     tag = EventLogger.FormatString(xmlNode2.InnerText);
                 }
                 string  exception = string.Empty;
                 XmlNode xmlNode3  = xmlElement2.SelectSingleNode("exception");
                 if (xmlNode3 != null)
                 {
                     exception = EventLogger.FormatString(xmlNode3.InnerText);
                 }
                 EventLogEntryType      enumValue  = EventLogger.GetEnumValue <EventLogEntryType>(xmlElement2, "eventtype");
                 ExEventLog.EventLevel  enumValue2 = EventLogger.GetEnumValue <ExEventLog.EventLevel>(xmlElement2, "level");
                 ExEventLog.EventPeriod enumValue3 = EventLogger.GetEnumValue <ExEventLog.EventPeriod>(xmlElement2, "period");
                 ExEventLog.EventTuple  tuple      = new ExEventLog.EventTuple(eventId, categoryId, enumValue, enumValue2, enumValue3);
                 this.tuples.Add(attribute2, new EventLogger.EventData(tuple, component, tag, exception));
                 string text2 = EventLogger.FormatString(innerText2);
                 if (!TriggerHandler.Triggers.ContainsKey(attribute2))
                 {
                     TriggerHandler.Triggers.Add(attribute2, new TriggerHandler.TriggerData(innerText3, text2));
                 }
             }
         }
     }
 }
コード例 #19
0
        // Token: 0x06000322 RID: 802 RVA: 0x0000D854 File Offset: 0x0000BA54
        public static void LogEvent(this ExEventLog.EventTuple tuple, string periodicKey, out bool fEventSuppressed, params object[] messageArgs)
        {
            SharedDiag.EventLog.LogEvent(tuple, periodicKey, out fEventSuppressed, messageArgs);
            if (!fEventSuppressed)
            {
                string text = tuple.EventLogToString(messageArgs);
                if (!string.IsNullOrEmpty(text))
                {
                    string text2 = string.Empty;
                    if (messageArgs.Length > 0)
                    {
                        text2 = string.Join(",\n", messageArgs);
                    }
                    EventLogEntryType  entryType = tuple.EntryType;
                    ReplayCrimsonEvent replayCrimsonEvent;
                    switch (entryType)
                    {
                    case EventLogEntryType.Error:
                        goto IL_7C;

                    case EventLogEntryType.Warning:
                        replayCrimsonEvent = ReplayCrimsonEvents.AppLogMirrorWarning;
                        goto IL_8A;

                    case (EventLogEntryType)3:
                        goto IL_84;

                    case EventLogEntryType.Information:
                        break;

                    default:
                        if (entryType != EventLogEntryType.SuccessAudit)
                        {
                            if (entryType != EventLogEntryType.FailureAudit)
                            {
                                goto IL_84;
                            }
                            goto IL_7C;
                        }
                        break;
                    }
                    replayCrimsonEvent = ReplayCrimsonEvents.AppLogMirrorInformational;
                    goto IL_8A;
IL_7C:
                    replayCrimsonEvent = ReplayCrimsonEvents.AppLogMirrorError;
                    goto IL_8A;
IL_84:
                    replayCrimsonEvent = ReplayCrimsonEvents.AppLogMirrorInformational;
IL_8A:
                    replayCrimsonEvent.LogGeneric(new object[]
                    {
                        SharedDiag.GetEventViewerEventId(tuple),
                        text,
                        text2
                    });
                }
            }
        }
コード例 #20
0
        // Token: 0x06000D38 RID: 3384 RVA: 0x0003A480 File Offset: 0x00038680
        public void SetBroken(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, params string[] setBrokenArgs)
        {
            this.m_fBroken = true;
            string[] argumentsWithDb = ReplicaInstance.GetArgumentsWithDb(setBrokenArgs, this.m_dbIdentity);
            int      num;
            string   value = setBrokenEventTuple.EventLogToString(out num, argumentsWithDb);

            this.m_errorMessage = new LocalizedString(value);
        }
コード例 #21
0
        private static void InternalLogEvent(ExEventLog.EventTuple tuple, string periodicKey, object[] messageArgs)
        {
            int num = messageArgs.Length;

            object[] array = new object[num + 1];
            Array.Copy(messageArgs, array, num);
            array[num] = "ActivityId: " + ActivityContext.ActivityId.FormatForLog();
            EcpEventLogExtensions.eventLog.LogEvent(tuple, periodicKey, array);
        }
コード例 #22
0
 private void LogEvent(ExEventLog.EventTuple eventTuple)
 {
     StoreDriverSubmission.LogEvent(eventTuple, null, new object[]
     {
         this.EventCounter,
         this.MailboxGuid,
         base.MdbGuid
     });
 }
コード例 #23
0
 private void ActOnLowSpace(IADDatabase db)
 {
     ExEventLog.EventTuple tuple_DatabaseSuspendedDueToLowSpace = ReplayEventLogConstants.Tuple_DatabaseSuspendedDueToLowSpace;
     tuple_DatabaseSuspendedDueToLowSpace.LogEvent(db.Name, new object[]
     {
         db.Name
     });
     FailureItemPublisherHelper.PublishFailureItem(FailureNameSpace.DagManagement, FailureTag.LowDiskSpaceStraggler, db.Guid, db.Name, null);
 }
コード例 #24
0
 public static void Log(ExEventLog.EventTuple tuple, string periodicKey, params object[] arguments)
 {
     object[] array = new object[arguments.Length + 3];
     array[0] = ProcessInfoEventLogger.ProcessName;
     array[1] = ProcessInfoEventLogger.ProcessId;
     array[2] = Environment.CurrentManagedThreadId;
     arguments.CopyTo(array, 3);
     StorageGlobals.EventLogger.LogEvent(tuple, periodicKey, array);
 }
コード例 #25
0
        private void SetBrokenInternal(FailureTag failureTag, ExEventLog.EventTuple setBrokenEventTuple, ExtendedErrorInfo extendedErrorInfo, params string[] setBrokenArgsPlusDb)
        {
            int       num;
            string    text             = setBrokenEventTuple.EventLogToString(out num, setBrokenArgsPlusDb);
            Exception failureException = extendedErrorInfo.FailureException;
            int       num2             = 0;

            if (failureException != null)
            {
                num2 = failureException.HResult;
            }
            ReplayCrimsonEvents.SetBroken.LogPeriodic <Guid, string, string, string, Exception, int>(this.m_databaseName, DiagCore.DefaultEventSuppressionInterval, this.m_guid, this.m_databaseName, text, Environment.StackTrace, failureException, num2);
            bool flag = false;

            lock (this.m_instance)
            {
                flag = this.IsBroken;
                this.FailureInfo.SetBroken(setBrokenEventTuple, new LocalizedString(text), extendedErrorInfo);
                if (this.m_perfmonCounters != null)
                {
                    this.m_perfmonCounters.Failed       = 1L;
                    this.m_perfmonCounters.Disconnected = 0L;
                    if (this.Suspended)
                    {
                        this.m_perfmonCounters.FailedSuspended = 1L;
                    }
                }
                bool flag3;
                setBrokenEventTuple.LogEvent(this.m_identity, out flag3, setBrokenArgsPlusDb);
                ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <string, FailureTag, string>((long)this.GetHashCode(), "{0} SetBroken with tag {1} because {2}", this.m_displayName, failureTag, text);
                MonitoredDatabase monitoredDatabase = MonitoredDatabase.FindMonitoredDatabase(this.ReplicaInstance.Configuration.ServerName, this.m_guid);
                if (monitoredDatabase != null && this.PassiveSeedingSourceContext != PassiveSeedingSourceContextEnum.None)
                {
                    ExTraceGlobals.ReplicaInstanceTracer.TraceDebug <Guid>((long)this.GetHashCode(), "Cancel seeding for mdb {0}", this.m_guid);
                    SourceSeedTable.Instance.CancelSeedingIfAppropriate(SourceSeedTable.CancelReason.CopyFailed, monitoredDatabase.DatabaseGuid);
                }
                bool flag4 = false;
                if (flag3 && (!RegistryParameters.DisableSetBrokenFailureItemSuppression || this.IsSuppressableFailureTag(failureTag)) && !this.IsNonSuppressableFailureTag(failureTag))
                {
                    flag4 = true;
                }
                if (!flag4 && failureTag != FailureTag.NoOp)
                {
                    FailureItemPublisherHelper.PublishAction(failureTag, this.m_guid, this.m_databaseName);
                }
                if (!flag)
                {
                    this.FailureInfo.PersistFailure(this.m_replayState);
                }
                this.ExternalStatus.Refresh();
            }
            if (!flag)
            {
                this.m_instance.PrepareToStop();
            }
        }
コード例 #26
0
 // Token: 0x06000D7C RID: 3452 RVA: 0x00059D1C File Offset: 0x00057F1C
 private void LogConfigurationException(ExEventLog.EventTuple eventLogConstant, string traceMessage, string exceptionMessage)
 {
     ExTraceGlobals.ConfigurationManagerTracer.TraceDebug <string>(0L, traceMessage, exceptionMessage);
     OwaDiagnostics.LogEvent(eventLogConstant, string.Empty, new object[]
     {
         OwaConfigurationManager.virtualDirectoryName,
         OwaConfigurationManager.webSiteName,
         exceptionMessage
     });
 }
コード例 #27
0
        protected void LogPeriodicEvent(ExEventLog.EventTuple eventInfo, params object[] messageArguments)
        {
            string periodicKey = this.context.InvocationInfo.ShellHostName;

            if (this.context.UserInfo.CurrentOrganizationId != null && !OrganizationId.ForestWideOrgId.Equals(this.context.UserInfo.CurrentOrganizationId))
            {
                periodicKey = this.context.UserInfo.CurrentOrganizationId.ToString();
            }
            TaskLogger.LogEvent(eventInfo, this.context.InvocationInfo, periodicKey, messageArguments);
        }
コード例 #28
0
 // Token: 0x06000BD4 RID: 3028 RVA: 0x0003058C File Offset: 0x0002E78C
 protected override void LogResponseParseFailureEvent(ExEventLog.EventTuple eventTuple, string periodicKey, object messageArg)
 {
     ExtensionDiagnostics.Logger.LogEvent(eventTuple, this.periodicKey, new object[]
     {
         this.scenario,
         this.requestId,
         this.uri,
         messageArg
     });
 }
コード例 #29
0
 private void ThrowParserException(string description, ExEventLog.EventTuple tuple, params object[] eventMessageArgs)
 {
     OwaDiagnostics.LogEvent(tuple, string.Empty, eventMessageArgs);
     throw new OwaInvalidInputException(string.Format(CultureInfo.InvariantCulture, "Invalid forms registry file {0}. Line Number: {1}. Position: {2}.{3}", new object[]
     {
         this.registryFile,
         this.reader.LineNumber.ToString(CultureInfo.InvariantCulture),
         this.reader.LinePosition.ToString(CultureInfo.InvariantCulture),
         (description != null) ? (" " + description) : string.Empty
     }), null, this);
 }
コード例 #30
0
ファイル: EventLogger.cs プロジェクト: YHZX2013/exchange_diff
 private static void LogPeriodicEvent(ExEventLog.EventTuple tuple, string periodicKey, params object[] messageArgs)
 {
     EventLogger.logger.LogEvent(tuple, periodicKey, messageArgs.Select(delegate(object arg)
     {
         if (!(arg is Exception))
         {
             return(arg);
         }
         return(EventLogger.TrimException((Exception)arg));
     }).ToArray <object>());
 }