Represents a top-level application transaction such as a network request.
Implements
Namespace: PostSharp.Patterns.Diagnostics.Transactions
Assembly: PostSharp.Patterns.Diagnostics.dll
Syntax
public class LoggingTransaction : IDisposableConstructors
| Name | Description |
|---|---|
| LoggingTransaction(LoggingTypeSource, in TransactionProperties, ITransactionPolicy) | Initializes a new LoggingTransaction. |
Properties
| Name | Description |
|---|---|
| Configuration | Gets the verbosity configuration the the current transaction. |
| CriticalCount | Gets the number of critical errors in the transaction. This may be used by the ITransactionPolicy to decide of the outcome of the transaction. |
| ErrorCount | Gets the number of errors in the transaction including critical errors. This may be used by the ITransactionPolicy to decide of the outcome of the transaction. |
| ExecutionTime | Gets the transaction execution time in milliseconds, up to this moment. This may be used by the ITransactionPolicy to decide of the outcome of the transaction. |
| IsSampled | Determines whether the current transaction was opened based on a sampling policy. |
| Policy | Gets the policy assigned to the current transaction. Can be null in the case of MultiplexerBackend. |
| Properties | Gets the list of logging properties associated with activity that created the transaction. |
| Source | Gets the LoggingTypeSource that opened the transaction. |
| WarningCount | Gets the number of warnings in the transaction. This may be used by the ITransactionPolicy to decide of the outcome of the transaction. |
Methods
| Name | Description |
|---|---|
| Close() | Closes the current transaction. This method does not call Dispose(). It is called before the corresponding LoggingContext has been disposed. |
| Dispose() | Disposes the current LoggingTransaction. This is called after the corresponding LoggingContext has been disposed. |
| Dispose(bool) | Disposes the current LoggingTransaction. This is called after the corresponding LoggingContext has been disposed. |
| TryOpen(TransactionRequirement) | Opens the transaction. The default implementation sets the current LoggingVerbosityConfiguration to the one defined by the policy. |