LoggingConfigurationManager.ConfigureFromXmlWithAutoReloadAsync Method |
Namespace: PostSharp.Patterns.Diagnostics
Assembly: PostSharp.Patterns.Diagnostics.Configuration (in PostSharp.Patterns.Diagnostics.Configuration.dll) Version: 6.10.10.0 (6.10.10.0)
public static Task<IDisposable> ConfigureFromXmlWithAutoReloadAsync( this LoggingBackend backend, Uri uri, TimeSpan autoReloadPeriod, CancellationToken cancellationToken = null )
Parameters
- backend
- Type: PostSharp.Patterns.Diagnostics.LoggingBackend
The backend to configure. - uri
- Type: System.Uri
The location of the configuration file. The schema is described in the LoggingConfigurationModel type. If you're using a cloud storage service, this should be a direct download link. - autoReloadPeriod
- Type: System.TimeSpan
The TimeSpan after which the configuration should be reloaded. If this parameter equals zero or TimeSpan.MaxValue, the configuration is never reloaded. - cancellationToken (Optional)
- Type: System.Threading.CancellationToken
A CancellationToken.
Return Value
Type: Task<IDisposable>An opaque IDisposable that must be disposed to stop reloading the configuration.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type LoggingBackend. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).This method always succeeds, even if the uri is incorrect or the content is corrupt. The reason is that the resource may become available or correct later.
Note that the XML file can contain code that will execute on the device from which you call this method. One cannot exclude the possibility for a malicious attacker to create file that would cause breaches of data or denial of service. Therefore, you must ensure that only authorized personnel have access in writing to the remote file. Additionally, this file must be publicly accessible in reading. Therefore, it should not include any sensitive piece of information (there should be no reason to do so). |