private void LogServiceActivationException(ServiceActivationException activationException)
 {
     if (System.ServiceModel.Diagnostics.Application.TD.ServiceExceptionIsEnabled())
     {
         System.ServiceModel.Diagnostics.Application.TD.ServiceException(activationException.ToString(), typeof(ServiceActivationException).FullName);
     }
     DiagnosticUtility.UnsafeEventLog.UnsafeLogEvent(TraceEventType.Error, EventLogCategory.WebHost, (System.ServiceModel.Diagnostics.EventLogEventId) (-1073610749), true, new string[] { System.ServiceModel.Activation.Diagnostics.TraceUtility.CreateSourceString(this), activationException.ToString() });
 }
コード例 #2
0
        void LogServiceActivationException(ServiceActivationException activationException)
        {
            if (TD2.ServiceExceptionIsEnabled())
            {
                TD2.ServiceException(this.eventTraceActivity, activationException.ToString(), typeof(ServiceActivationException).FullName);
            }

            if (TD.ServiceActivationExceptionIsEnabled())
            {
                TD.ServiceActivationException(activationException != null ? activationException.ToString() : string.Empty, activationException);
            }
            DiagnosticUtility.UnsafeEventLog.UnsafeLogEvent(TraceEventType.Error, (ushort)System.Runtime.Diagnostics.EventLogCategory.WebHost, 
                (uint)System.Runtime.Diagnostics.EventLogEventId.WebHostFailedToProcessRequest, true,
                    TraceUtility.CreateSourceString(this), activationException.ToString());
        }
 private static void LogServiceActivationException(ServiceActivationException exception)
 {
     if (exception.InnerException is HttpException)
     {
         string message = SafeTryGetHtmlErrorMessage((HttpException) exception.InnerException);
         if (string.IsNullOrEmpty(message))
         {
             message = exception.Message;
         }
         DiagnosticUtility.UnsafeEventLog.UnsafeLogEvent(TraceEventType.Error, EventLogCategory.WebHost, (System.ServiceModel.Diagnostics.EventLogEventId) (-1073610750), true, new string[] { System.ServiceModel.Activation.Diagnostics.TraceUtility.CreateSourceString(hostingManager), message, exception.ToString() });
     }
     else
     {
         DiagnosticUtility.UnsafeEventLog.UnsafeLogEvent(TraceEventType.Error, EventLogCategory.WebHost, (System.ServiceModel.Diagnostics.EventLogEventId) (-1073610749), true, new string[] { System.ServiceModel.Activation.Diagnostics.TraceUtility.CreateSourceString(hostingManager), exception.ToString() });
     }
     if (System.ServiceModel.Diagnostics.Application.TD.ServiceExceptionIsEnabled())
     {
         System.ServiceModel.Diagnostics.Application.TD.ServiceException(exception.ToString(), typeof(ServiceActivationException).FullName);
     }
 }