@@ -8,42 +8,26 @@ namespace Runpath.Extensions.Logging.AzureEventHubs
8
8
[ ProviderAlias ( "AzureEventHubs" ) ]
9
9
public class AzureEventHubsLoggerProvider : ILoggerProvider , ISupportExternalScope
10
10
{
11
- private readonly IOptionsMonitor < AzureEventHubsLoggerOptions > options ;
12
11
private readonly ConcurrentDictionary < string , AzureEventHubsLogger > loggers ;
13
12
private readonly IAzureEventHubsLoggerFormatter formatter ;
14
13
private readonly IAzureEventHubsLoggerProcessor processor ;
15
14
16
15
private IDisposable optionsReloadToken ;
17
16
private IExternalScopeProvider scopeProvider ;
18
17
19
- public AzureEventHubsLoggerProvider ( IOptionsMonitor < AzureEventHubsLoggerOptions > options , IAzureEventHubsLoggerFormatter formatter , IAzureEventHubsLoggerProcessor processor )
18
+ public AzureEventHubsLoggerProvider ( IAzureEventHubsLoggerFormatter formatter , IAzureEventHubsLoggerProcessor processor )
20
19
{
21
- this . options = options ;
22
- this . loggers = new ConcurrentDictionary < string , AzureEventHubsLogger > ( ) ;
23
-
24
- ReloadLoggerOptions ( options . CurrentValue ) ;
25
-
26
20
this . formatter = formatter ;
27
21
this . processor = processor ;
22
+ this . loggers = new ConcurrentDictionary < string , AzureEventHubsLogger > ( ) ;
28
23
29
24
SetScopeProvider ( NullExternalScopeProvider . Instance ) ;
30
25
}
31
26
32
- private void ReloadLoggerOptions ( AzureEventHubsLoggerOptions options )
33
- {
34
- foreach ( var logger in this . loggers )
35
- {
36
- logger . Value . Options = options ;
37
- }
38
-
39
- this . optionsReloadToken = this . options . OnChange ( ReloadLoggerOptions ) ;
40
- }
41
-
42
27
/// <inheritdoc/>
43
28
public ILogger CreateLogger ( string name ) => this . loggers . GetOrAdd ( name ,
44
29
_ => new AzureEventHubsLogger ( name , this . formatter , this . processor )
45
30
{
46
- Options = this . options . CurrentValue ,
47
31
ScopeProvider = this . scopeProvider
48
32
} ) ;
49
33
0 commit comments