PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics
Open sandboxFocus

PostSharp.Patterns.Diagnostics Namespace

Classes

AwaitInstrumentationAspect

AwaitInstrumentationAspect.Serializer

CloseActivityOptions

Options of the closing methods of the LogActivity<TActivityDescription> type.

ContextIdGenerationStrategy

Enumerates the different strategies to generate the value of the Id strategy.

CustomRecordLoggingOptions

Options for custom logging records. Exposed on the CustomRecordLoggingOptions property.

DefaultLoggingExceptionHandler

An implementation of the ILoggingExceptionHandler that attempts to log exceptions to the Meta logging role, then disables the backlog in case of internal exception (but not in case of invalid user code). Not to be confused with ILoggerExceptionHandler.

FormattedMessageBuilder

Creates messages based on a human-readable formatted string. These messages are suitable for structured logging are not optimal for machine analysis. For more succinct code, consider including the using static PostSharp.Patterns.Diagnostics.FormattedMessageBuilder statement.

LogActivity

Represents a logged custom activity, i.e. something that a beginning and an end with a specific outcome. This class is instantiated by the legacy API of the Logger class. For the modern API, see LogActivity<TActivityDescription>.

LogActivity<TActivityDescription>

Represents a logged custom activity, i.e. something that has a beginning and an end with a specific outcome. This class is instantiated by the new API of the LogSource class.

LogActivityKind

Kinds of LogActivity.

LogActivityOptions

Options of a new LogActivity.

LogAttribute

Custom attribute that, when applied on a method, causes PostSharp to implement tracing before and after execution of this method.

LogAttributeBase

Base class for all method-level logging aspects.

LogExceptionAttribute

Custom attribute that, when applied on a method, causes PostSharp to implement tracing upon exception in this method.

Logger

Allows to emit custom log records and define custom activities. This class is obsolete. Use LogSource for new developments.

LoggerFactoryExtensions

Extension methods for the ILoggerFactory interface.

LoggingAbstractSource

Exposes the current LoggingTypeSource for a given role and System.Type.

LoggingBackend

Base class for all logging back-ends (sometimes names sinks, targets, listeners) of the PostSharp logging system.

LoggingBackendOptions

Options for the LoggingBackend class.

LoggingBuildTimeConfiguration

Root element of the XML configuration (postsharp.config) for the Logging component.

LoggingConfigurationManager

Configures a LoggingBackend from an XML file.

LoggingContextLocalConfiguration

Stores the context-sensitive configuration, i.e. the configuration that is specific to the current execution context.

LoggingContextLocalConfigurationScope

Represents a scope started with the WithContextLocalConfiguration(LoggingContextLocalConfiguration) method. Dispose the scope to close it. It is recommended to use the using keyword.

LoggingContextMismatchException

Exception thrown when an operation assumes a different current LoggingContext.

LoggingException

Exception thrown by ThrowingLoggingExceptionHandler when the logging subsystem throws an exception. The InnerException property gets the original Exception.

LoggingExceptionInfo

Arguments of the OnInternalException(LoggingExceptionInfo) method.

LoggingNamespaceSource

Allows to enable or disable logging for a whole namespace.

LoggingOptions

Represents the build-time options for logging records. This class is exposed by DefaultOptions and ExceptionOptions. The values of this class cannot be changed at run-time because they influence the way PostSharp instruments the code.

LoggingOptions.Serializer

LoggingProfile

Logging profiles are named configurations of logging aspects and influence the way PostSharp generates the code instrumentation. They are typically instantiated in postsharp.config.

LoggingProfile.Serializer

LoggingProfileCollection

Collection of instances of the LoggingProfile class.

LoggingProfileRepository

Provides access to logging profiles (LoggingProfile) at run-time. Exposed by the Profiles property. Note that each assembly of the AppDomain contains its own copy of each LoggingProfile used in this assembly, and each copy may be different, even if they have the same name.

LoggingProperty

Represents a property (a name, a value and a few options).

LoggingRoleConfiguration

Role-specific logging options. There is one instance of the LoggingRoleConfiguration class for each logging role. The LoggingRoleConfiguration is a run-time concept, with no build-time meaning.

LoggingRoleConfigurationRepository

Provides access to role-specific options (LoggingRoleConfiguration). This class is exposed on the Profiles.

LoggingRoles

List of standard logging roles.

LoggingServices

The entry point to configure PostSharp.Patterns.Diagnostics logging at run-time.

LoggingServices.Formatters

Provides access to formatters. This class is exposed on the LoggingServices.Formatters property.

LoggingSourceLocalState

Stores the state of a LoggingAbstractSource for the current execution context.

LoggingTypeSource

Allows to enable or disable logging for a specific type and exposes some information regarding the verbosity for this type. Note that a type here does not need to map to a .NET type. It can be an arbitrary dot-separated string.

LoggingVerbosityConfiguration

Manages the configuration of the minimal LogLevel for individual types and namespaces. This class is exposed by the Verbosity property. To create a new instance of this class, call CreateVerbosityConfiguration().

LogLevel

Specifies the severity of a logged message.

LogRecordKind

Kinds of log entry.

LogRecordKindExtensions

Extensions to the LogRecordKind enum.

LogSource

Allow to write log messages and trace the execution of activities. This class is optimized for use with C# 7.2 or later. For previous compiler versions, consider using the legacy PostSharp.Patterns.Diagnostics.LogSource.Logger class.

LogValueAttribute

Custom attribute that, when applied on a field or property, causes PostSharp to implement tracing when its value changes.

NotLoggedAttribute

Indicates that the value of this parameter should not be logged.

OpenActivityOptions

Argument of the OpenActivity<T>(in T, in OpenActivityOptions) method.

SemanticMessageBuilder

Creates semantic messages composed of a message name and a list of properties given as name-value pairs. These messages are ideal for machine analysis. For more succinct code, consider including the using static PostSharp.Patterns.Diagnostics.MessageBuilder statement.

ThrowingLoggingExceptionHandler

An implementation of the ILoggingExceptionHandler that throws a LoggingException or an System.InvalidOperationException.

WriteMessageOptions

Options for the Exception method.

Interfaces

ILogActivity

Exposes the public API of the generic value type LogActivity<TActivityDescription>.

ILogAspect

Base interface for all method-level logging aspects.

ILoggingExceptionHandler

Defines methods called in case of exception in the logging component.

ILogValueAspect

Base interface for all location-level logging aspects.