Open sandboxFocus

Namespace PostSharp.Patterns.Diagnostics

Classes

CustomRecordLoggingOptions

Represents the options for custom log records. These options are exposed by the CustomRecordLoggingOptions property.

DefaultLoggingExceptionHandler

Implementation of ILoggingExceptionHandler that attempts to log exceptions to the Meta logging role, then disables the backlog in case of an 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 but 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, that is, something that has 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>.

LogAttribute

Custom attribute that, when applied on a method, causes PostSharp to implement tracing before and after the 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 when an exception occurs in this method.

LogRecordKindExtensions

Provides extension methods for the LogRecordKind enum.

LogSource

Allows writing log messages and tracing 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.

Logger

Allows emitting custom log records and defining custom activities. This class is obsolete. Use LogSource for new development.

LoggerFactoryExtensions

Provides extension methods for the ILoggerFactory interface.

LoggingAbstractSource

Exposes the current LoggingTypeSource for a given role and Type.

LoggingBackend

Base class for all logging backends (sometimes called sinks, targets, or listeners) of the PostSharp logging system.

LoggingBackendOptions

Represents the options of the LoggingBackend class.

LoggingBuildTimeConfiguration

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

LoggingConfigurationManager

Provides methods that configure a LoggingBackend from an XML file.

LoggingContextLocalConfiguration

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

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 contains the original Exception.

LoggingExceptionInfo

Arguments of the OnInternalException(LoggingExceptionInfo) method.

LoggingNamespaceSource

Allows enabling or disabling 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. This class is 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 property has 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 by the Profiles property.

LoggingRoles

Defines the standard logging roles.

LoggingServices

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

LoggingServices.Formatters

Provides access to the formatters used by logging. All members of this class are static.

LoggingTypeSource

Allows enabling or disabling logging for a specific type, and exposes some information about 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 minimum LogLevel for individual types and namespaces. This class is exposed by the Verbosity property. To create a new instance of this class, call CreateVerbosityConfiguration().

NotLoggedAttribute

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

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.SemanticMessageBuilder statement.

ThrowingLoggingExceptionHandler

Implementation of ILoggingExceptionHandler that throws a LoggingException or an InvalidOperationException.

Structs

CloseActivityOptions

Represents the options of the closing methods of the LogActivity<TActivityDescription> type.

LogActivityOptions

Represents the options of a new LogActivity.

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.

LoggingContextLocalConfigurationScope

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

LoggingSourceLocalState

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

OpenActivityOptions

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

WriteMessageOptions

Represents the options of the Write<T>(in T, in WriteMessageOptions) method.

Interfaces

ILogActivity

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

ILogAspect

Interface that all method-level logging aspects implement.

ILogValueAspect

Interface that all location-level logging aspects implement.

ILoggingExceptionHandler

Defines the methods that are called when an exception occurs in the logging component.

Enums

ContextIdGenerationStrategy

Specifies the strategies used to generate the value of the Id property.

LogActivityKind

Specifies the kind of a LogActivity.

LogLevel

Specifies the severity of a logged message.

LogRecordKind

Specifies the kinds of log records.