PostSharp6.1/API Reference/Post­Sharp.​Patterns.​Diagnostics Namespace/Logging­Context­Local­Configuration Class

LoggingContextLocalConfiguration Class

Stores the context-sensitive configuration, i.e. the configuration that is specific to the current execution context.
Inheritance Hierarchy
System.Object
  PostSharp.Patterns.Diagnostics.LoggingContextLocalConfiguration

Namespace:  PostSharp.Patterns.Diagnostics
Assembly:  PostSharp.Patterns.Diagnostics (in PostSharp.Patterns.Diagnostics.dll) Version: 6.1.23.0 (6.1.23.0)
Syntax
C#
public class LoggingContextLocalConfiguration

The LoggingContextLocalConfiguration type exposes the following members.

Constructors
  NameDescription
Protected methodLoggingContextLocalConfiguration
Initializes a new LoggingContextLocalConfiguration.
Properties
  NameDescription
Public propertyIsReadOnly
Determines whether the current LoggingContextLocalConfiguration is read-only. A LoggingContextLocalConfiguration is frozen when it starts being used by a
Public propertyVerbosity
Gets the configuration of the minimal LogLevel for the current LoggingContextLocalConfiguration.
Methods
  NameDescription
Public methodClone
Returns a shallow copy of the current instance, sharing the same value of the Verbosity property.
Protected methodFreeze
Prevents changes in the current instance. This method is called
Remarks

User code can switch from one LoggingContextLocalConfiguration to another for the current context using the WithContextLocalConfiguration(LoggingContextLocalConfiguration) method. The current instance is exposed by the CurrentContextLocalConfiguration property. The default instance is exposed by the DefaultContextLocalConfiguration.

Unlike LoggingVerbosityConfiguration, this class is lightweight and can be allocated at high frequency. However, it is recommended that only a few instances of the LoggingVerbosityConfiguration class are created.

See Also