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.
Declaration
public static Task<IDisposable> ConfigureFromXmlWithAutoReloadAsync(this LoggingBackend backend, Uri uri, TimeSpan autoReloadPeriod, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description |
|---|---|---|
| LoggingBackend | backend | The backend to configure. |
| Uri | uri | The location of the configuration file. The schema is described in the LoggingConfigurationModel type. If you are using a cloud storage service, this should be a direct download link. |
| TimeSpan | autoReloadPeriod | The TimeSpan after which the configuration should be reloaded. If this parameter equals zero or |
| CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| Task<IDisposable> | An opaque IDisposable that must be disposed to stop reloading the configuration. |
Remarks
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.
security
Note that the XML file can contain code that will execute on the device from which you call this method. A malicious attacker could create a file that causes a data breach or a denial of service. Therefore, you must ensure that only authorized personnel have write access to the remote file. Additionally, this file must be publicly readable. Therefore, it should not include any sensitive information. There should be no reason to do so.