示例#1
0
        static internal void TraceAndLogEvent(TraceEventType type, string code, string description, TraceRecord trace, Exception exception, ref Guid activityId, object source)
        {
            bool   shouldTrace = DiagnosticTrace.ShouldTrace(type);
            string traceString = null;

            try
            {
                LogEvent(type, code, description, trace, exception, source);

                if (shouldTrace)
                {
                    DiagnosticTrace.TraceEvent(type, code, description, trace, exception, ref activityId, false, source);
                }
            }
            catch (OutOfMemoryException)
            {
                throw;
            }
            catch (StackOverflowException)
            {
                throw;
            }
            catch (ThreadAbortException)
            {
                throw;
            }
            catch (Exception e)
            {
                LogTraceFailure(traceString, e);
            }
        }
 internal static void Trace(string traceSource)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning, "http://msdn.microsoft.com/2004/06/System/Transactions/ConfiguredDefaultTimeoutAdjusted", System.Transactions.SR.GetString("TraceConfiguredDefaultTimeoutAdjusted"), record);
     }
 }
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeIncomplete", System.Transactions.SR.GetString("TraceTransactionScopeIncomplete"), record);
     }
 }
 internal static void Trace(string traceSource, string exceptionMessage)
 {
     lock (record)
     {
         record.traceSource      = traceSource;
         record.exceptionMessage = exceptionMessage;
         DiagnosticTrace.TraceEvent(TraceEventType.Error, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionException", System.Transactions.SR.GetString("TraceTransactionException"), record);
     }
 }
 internal static void Trace(string traceSource, Exception exception)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.exception   = exception;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/ExceptionConsumed", System.Transactions.SR.GetString("TraceExceptionConsumed"), record);
     }
 }
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionDeserialized", System.Transactions.SR.GetString("TraceTransactionDeserialized"), record);
     }
 }
示例#7
0
 internal static void Trace(string traceSource, string methodName)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.methodName  = methodName;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/MethodExited", System.Transactions.SR.GetString("TraceMethodExited"), record);
     }
 }
 internal static void Trace(string traceSource, Guid rmId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.rmId        = rmId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information, "http://msdn.microsoft.com/2004/06/System/Transactions/RecoveryComplete", System.Transactions.SR.GetString("TraceRecoveryComplete"), record);
     }
 }
 internal static void Trace(string traceSource, EnlistmentTraceIdentifier enTraceId, NotificationCall notCall)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.enTraceId   = enTraceId;
         record.notCall     = notCall;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/EnlistmentNotificationCall", System.Transactions.SR.GetString("TraceEnlistmentNotificationCall"), record);
     }
 }
 internal static void Trace(string traceSource, TransactionTraceIdentifier localTxTraceId, TransactionTraceIdentifier distTxTraceId)
 {
     lock (record)
     {
         record.traceSource    = traceSource;
         record.localTxTraceId = localTxTraceId;
         record.distTxTraceId  = distTxTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionPromoted", System.Transactions.SR.GetString("TraceTransactionPromoted"), record);
     }
 }
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId, DependentCloneOption option)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         record.option      = option;
         DiagnosticTrace.TraceEvent(TraceEventType.Information, "http://msdn.microsoft.com/2004/06/System/Transactions/DependentCloneCreated", System.Transactions.SR.GetString("TraceDependentCloneCreated"), record);
     }
 }
示例#12
0
 internal static void Trace(string traceSource, Type tmType, string nodeName)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.tmType      = tmType;
         record.nodeName    = nodeName;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionManagerCreated", System.Transactions.SR.GetString("TraceTransactionManagerCreated"), record);
     }
 }
示例#13
0
 internal static void Trace(string traceSource, EnlistmentTraceIdentifier enTraceId, EnlistmentCallback callback)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.enTraceId   = enTraceId;
         record.callback    = callback;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose, "http://msdn.microsoft.com/2004/06/System/Transactions/EnlistmentCallbackPositive", System.Transactions.SR.GetString("TraceEnlistmentCallbackPositive"), record);
     }
 }
示例#14
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId, TransactionScopeResult txScopeResult)
 {
     lock (record)
     {
         record.traceSource   = traceSource;
         record.txTraceId     = txTraceId;
         record.txScopeResult = txScopeResult;
         DiagnosticTrace.TraceEvent(TraceEventType.Information, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeCreated", System.Transactions.SR.GetString("TraceTransactionScopeCreated"), record);
     }
 }
示例#15
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier scopeTxTraceId, TransactionTraceIdentifier currentTxTraceId)
 {
     lock (record)
     {
         record.traceSource      = traceSource;
         record.scopeTxTraceId   = scopeTxTraceId;
         record.currentTxTraceId = currentTxTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning, "http://msdn.microsoft.com/2004/06/System/Transactions/TransactionScopeCurrentTransactionChanged", System.Transactions.SR.GetString("TraceTransactionScopeCurrentTransactionChanged"), record);
     }
 }
示例#16
0
 internal static void Trace(string traceSource)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning,
                                    TransactionsTraceCode.ConfiguredDefaultTimeoutAdjusted,
                                    SR.GetString(SR.TraceConfiguredDefaultTimeoutAdjusted),
                                    record);
     }
 }
 internal static void Trace(string traceSource, EnlistmentTraceIdentifier enTraceId, EnlistmentType enType, EnlistmentOptions enOptions)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.enTraceId   = enTraceId;
         record.enType      = enType;
         record.enOptions   = enOptions;
         DiagnosticTrace.TraceEvent(TraceEventType.Information, "http://msdn.microsoft.com/2004/06/System/Transactions/Enlistment", System.Transactions.SR.GetString("TraceEnlistment"), record);
     }
 }
示例#18
0
 internal static void Trace(string traceSource, string exceptionMessage)
 {
     lock (s_record)
     {
         s_record._traceSource      = traceSource;
         s_record._exceptionMessage = exceptionMessage;
         DiagnosticTrace.TraceEvent(TraceEventType.Critical,
                                    TransactionsTraceCode.InternalError,
                                    SR.TraceInternalError,
                                    s_record);
     }
 }
示例#19
0
 internal static void Trace(string traceSource, Guid rmId)
 {
     lock (s_record)
     {
         s_record._traceSource = traceSource;
         s_record._rmId        = rmId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information,
                                    TransactionsTraceCode.Reenlist,
                                    SR.TraceReenlist,
                                    s_record);
     }
 }
示例#20
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (s_record)
     {
         s_record._traceSource = traceSource;
         s_record._txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning,
                                    TransactionsTraceCode.TransactionTimeout,
                                    SR.TraceTransactionTimeout,
                                    s_record);
     }
 }
示例#21
0
 internal static void Trace(string traceSource, string methodName)
 {
     lock (s_record)
     {
         s_record._traceSource = traceSource;
         s_record._methodName  = methodName;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose,
                                    TransactionsTraceCode.MethodExited,
                                    SR.TraceMethodExited,
                                    s_record);
     }
 }
示例#22
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose,
                                    TransactionsTraceCode.CloneCreated,
                                    SR.GetString(SR.TraceCloneCreated),
                                    record);
     }
 }
示例#23
0
 internal static void Trace(string traceSource, Guid rmId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.rmId        = rmId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information,
                                    TransactionsTraceCode.Reenlist,
                                    SR.GetString(SR.TraceReenlist),
                                    record);
     }
 }
示例#24
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Warning,
                                    TransactionsTraceCode.TransactionTimeout,
                                    SR.GetString(SR.TraceTransactionTimeout),
                                    record);
     }
 }
示例#25
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information,
                                    TransactionsTraceCode.DependentCloneComplete,
                                    SR.GetString(SR.TraceDependentCloneComplete),
                                    record);
     }
 }
示例#26
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Information,
                                    TransactionsTraceCode.TransactionScopeDisposed,
                                    SR.GetString(SR.TraceTransactionScopeDisposed),
                                    record);
     }
 }
示例#27
0
 internal static void Trace(string traceSource, TransactionTraceIdentifier txTraceId)
 {
     lock (s_record)
     {
         s_record._traceSource = traceSource;
         s_record._txTraceId   = txTraceId;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose,
                                    TransactionsTraceCode.TransactionCommitted,
                                    SR.TraceTransactionCommitted,
                                    s_record);
     }
 }
示例#28
0
 internal static void Trace(string traceSource, string methodName)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.methodName  = methodName;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose,
                                    TransactionsTraceCode.MethodExited,
                                    SR.GetString(SR.TraceMethodExited),
                                    record);
     }
 }
示例#29
0
 internal static void Trace(string traceSource, string exceptionMessage)
 {
     lock (record)
     {
         record.traceSource      = traceSource;
         record.exceptionMessage = exceptionMessage;
         DiagnosticTrace.TraceEvent(TraceEventType.Critical,
                                    TransactionsTraceCode.InternalError,
                                    SR.GetString(SR.TraceInternalError),
                                    record);
     }
 }
示例#30
0
 internal static void Trace(string traceSource, Exception exception)
 {
     lock (record)
     {
         record.traceSource = traceSource;
         record.exception   = exception;
         DiagnosticTrace.TraceEvent(TraceEventType.Verbose,
                                    TransactionsTraceCode.ExceptionConsumed,
                                    SR.GetString(SR.TraceExceptionConsumed),
                                    record);
     }
 }