Open sandboxFocus

Class LoggingConfigurationManager

Provides methods that configure a LoggingBackend from an XML file.

Inheritance
LoggingConfigurationManager
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.Configuration.dll
Syntax
public static class LoggingConfigurationManager
Remarks

The XML file sets the default verbosity per namespace or type and can define transaction policies that change the verbosity of selected requests. Its format is described by LoggingConfigurationModel.

Use ConfigureFromXmlWithAutoReloadAsync(LoggingBackend, Uri, TimeSpan, CancellationToken) to change the verbosity of a running application without redeploying it: the method downloads the file, typically from an HTTPS location, and reloads it periodically. It does not throw when the file cannot be downloaded or parsed; it reports the error through PostSharp Logging. ConfigureFromXmlAsync(LoggingBackend, Uri, CancellationToken) loads the file once and throws in that case, except for errors in the verbosity element, which are only reported.

The file can contain expressions that execute in the application, so only authorized personnel should have write access to it.

Methods

Name Description
ConfigureFromXml(LoggingBackend, XDocument, bool)

Configures a LoggingBackend from an XDocument.

ConfigureFromXml(LoggingBackend, XElement, bool)

Configures a LoggingBackend from an XElement.

ConfigureFromXmlAsync(LoggingBackend, Uri, CancellationToken)

Configures a LoggingBackend from an XML configuration file whose location is specified in a Uri.

ConfigureFromXmlWithAutoReloadAsync(LoggingBackend, Uri, TimeSpan, CancellationToken)

Configures a LoggingBackend from an XML configuration file whose location is specified in a Uri and specifies a TimeSpan at which the file should be refreshed from source.

ResetConfiguration(LoggingBackend)

Removes the TransactionPolicySelector and resets the DefaultVerbosity of a given LoggingBackend.

StopAutoReloadConfigurationAsync(LoggingBackend)

Stops all auto-refresh configuration set up by ConfigureFromXmlWithAutoReloadAsync(LoggingBackend, Uri, TimeSpan, CancellationToken) and waits until all pending operations have completed.

See Also