public void TraceEtwException(Exception exception, EventLevel eventLevel)
        {
            switch (eventLevel)
            {
            case EventLevel.Error:
            case EventLevel.Warning:
                if (WcfEventSource.Instance.ThrowingEtwExceptionIsEnabled())
                {
                    string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
                    WcfEventSource.Instance.ThrowingEtwException(_eventSourceName, exception != null ? exception.ToString() : string.Empty, serializedException);
                }
                break;

            case EventLevel.Critical:
                if (WcfEventSource.Instance.EtwUnhandledExceptionIsEnabled())
                {
                    string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
                    WcfEventSource.Instance.EtwUnhandledException(exception != null ? exception.ToString() : string.Empty, serializedException);
                }
                break;

            default:
                if (WcfEventSource.Instance.ThrowingEtwExceptionVerboseIsEnabled())
                {
                    string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);
                    WcfEventSource.Instance.ThrowingEtwExceptionVerbose(_eventSourceName, exception != null ? exception.ToString() : string.Empty, serializedException);
                }

                break;
            }
        }
Exemple #2
0
        /// <summary>
        /// Gets trace definition like: Handling an exception.  Exception details: {0}
        /// Event description ID=57394, Level=informational, Channel=Analytic
        /// </summary>
        /// <param name="trace">The trace provider</param>
        /// <param name="param0">Parameter 0 for event: Handling an exception.  Exception details: {0}</param>
        /// <param name="exception">Exception associated with the event</param>
        internal static void HandledException(EtwDiagnosticTrace trace, string param0, System.Exception exception)
        {
            string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);

            WcfEventSource.Instance.HandledException(param0, serializedException);
        }
Exemple #3
0
        /// <summary>
        /// Gets trace definition like: Throwing an exception. Source: {0}. Exception details: {1}
        /// Event description ID=57410, Level=warning, Channel=Analytic
        /// </summary>
        /// <param name="trace">The trace provider</param>
        /// <param name="param0">Parameter 0 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
        /// <param name="param1">Parameter 1 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
        /// <param name="exception">Exception associated with the event</param>
        internal static void ThrowingEtwException(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
        {
            string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);

            WcfEventSource.Instance.ThrowingEtwException(param0, param1, serializedException);
        }
Exemple #4
0
        /// <summary>
        /// Gets trace definition like: Throwing an exception. Source: {0}. Exception details: {1}
        /// Event description ID=57407, Level=verbose, Channel=Analytic
        /// </summary>
        /// <param name="trace">The trace provider</param>
        /// <param name="param0">Parameter 0 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
        /// <param name="param1">Parameter 1 for event: Throwing an exception. Source: {0}. Exception details: {1}</param>
        /// <param name="exception">Exception associated with the event</param>
        internal static void ThrowingExceptionVerbose(EtwDiagnosticTrace trace, string param0, string param1, System.Exception exception)
        {
            string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, int.MaxValue);

            WcfEventSource.Instance.ThrowingExceptionVerbose(param0, param1, serializedException);
        }
Exemple #5
0
        /// <summary>
        /// Gets trace definition like: Handling an exception  Exception details: {0}
        /// Event description ID=57406, Level=verbose, Channel=Analytic
        /// </summary>
        /// <param name="trace">The trace provider</param>
        /// <param name="param0">Parameter 0 for event: Handling an exception  Exception details: {0}</param>
        /// <param name="exception">Exception associated with the event</param>
        internal static void HandledExceptionVerbose(EtwDiagnosticTrace trace, string param0, System.Exception exception)
        {
            string serializedException = EtwDiagnosticTrace.ExceptionToTraceString(exception, MaxExceptionStringLength);

            WcfEventSource.Instance.HandledExceptionVerbose(param0, serializedException);
        }