Open sandboxFocus

Property AllowDynamicEnabling

AllowDynamicEnabling

Gets or sets a value indicating whether logging can be dynamically enabled or disabled after initialization. The default value of this property is true. When it is set to false, PostSharp generates code that allows the JIT compiler to completely remove logging instructions for types that are not enabled.

Declaration
public bool AllowDynamicEnabling { get; set; }
Property Value
Type Description
bool
Remarks

When this property is false, the generated code evaluates once, in static fields, whether each log level is enabled for the logged type. Changes to the verbosity made after these fields are initialized are ignored for this type. Configure the LoggingVerbosityConfiguration when the application initializes, before the logged code runs.

See Also